Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ELECTRON
Si n ce 1977 H i - Tech
f o r t h e Mach i n e - To o l
CNC
Z32
PROGRAMMING MANUAL
Document M96
C9 - 23.2.15
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.
The information contained herein has been carefully checked for accuracy and reliability, however, D. Electron accepts no responsibility
whatsoever for any inaccuracies. D. Electron reserves the right to carry out whatever changes it considers expedient to improve the
performance or reliability of its products.
CONTENTS
D. ELECTRON i
CNC Z32 Programming Manual Contents
ii
D. ELECTRON
Contents CNC Z32 Programming Manual
D. ELECTRON iii
CNC Z32 Programming Manual Contents
3.8 PARAMETERS..............................................................................................................................................................144
3.8.1 Axis names ...............................................................................................................................................................145
3.8.2 System parameters....................................................................................................................................................145
3.8.3 User parameters........................................................................................................................................................147
3.8.4 Parameters array PAR[512] .....................................................................................................................................147
3.8.5 Logic array of parameters PAL[512] .......................................................................................................................148
3.8.6 Logic array of parameters PLS[512] ........................................................................................................................148
3.8.7 Retentive parameters array PRM[...] ........................................................................................................................148
3.8.8 Parameters array POS[12]........................................................................................................................................149
3.8.9 Parameters array ZFP[1023] ....................................................................................................................................149
3.8.10 Parameters array SET[60] ....................................................................................................................................149
3.8.11 Three letters parameters .......................................................................................................................................152
3.8.12 Use of parameters.................................................................................................................................................152
3.8.13 Programming of parameters through expressions.................................................................................................153
3.8.14 Parameters in permanent memory ........................................................................................................................155
3.8.15 Parameters #, #A #Q and ##[33] in real-time ...................................................................................................155
3.9 THREE LETTERS FUNCTIONS ABS, TAN, NEI, INT, RST .................................................................................156
3.9.1 Absolute value function ABS(expression) ...............................................................................................................156
3.9.2 Tangent function TAN(expression)..........................................................................................................................156
3.9.3 Truncated integer INT(expression) and rounded integer NEI(expression) functions...............................................156
3.9.4 Status read function RST(expression) ......................................................................................................................158
iv
D. ELECTRON
Contents CNC Z32 Programming Manual
D. ELECTRON v
CNC Z32 Programming Manual Contents
vi
D. ELECTRON
Contents CNC Z32 Programming Manual
11.3 TRASLATION............................................................................................................................................................336
11.3.1 Axes movements and traslation ............................................................................................................................336
D. ELECTRON vii
CNC Z32 Programming Manual Contents
viii
D. ELECTRON
Contents CNC Z32 Programming Manual
D. ELECTRON ix
CNC Z32 Programming Manual Chapter 1 - Files organization and structures
CHAPTER 1
1.1 INTRODUCTION
CHARACTERS 'O' and '0'
Letter 'O' and number zero '0' are so similar that even a skilled programmer may confuse them;
however, we must remember that the machine codes of these two characters are different and the
CNC do (and MUST) distinguish between them.
Therefore, please remember:
O => alphabetical letter 'O'
0 => number zero
IMPORTANT NOTE
Z32 is a numerical control with extremely open programming and structure. This manual
provides technical details of the CNC, especially in reference to milling machines and machining
centers, but does not describe specific installations.
To configure the machine the manufacturer of the machine tool installs subprograms, special
cycles, PLC and calibration programs that influence the performance and behaviour of the Z32.
Please consult with care the information supplied by the manufacturer.
D. ELECTRON 1
Chapter 1 - Files organization and structures CNC Z32 Programming Manual
The last performance includes all the operations that allow the computer to know the operations
requested by the operator and consequently to calculate the values and the movements of the
axes, the machine functions to be performed, etc.
Various types of operations can be requested: one of the most important is to machine a part
with the program already loaded in the memory of the Z32.
The purpose of this handbook is to describe the instructions the Z32 will accept, inside a
program to be executed automatically.
PROCESS 0 1 2 3 4 5
PARAMETER TABLE 125 122 119 116 113 110
ORIGIN TABLE 126 123 120 117 114 111
TOOL TABLE 127 124 121 118 115 112
BASE ORIGIN TABLE 237 236 235 234 233 232
The files are accessible through editor activity (for modification or creation of files, please refer
to the user manual). They can be copied from the hard disk to floppy disk and vice versa, or sent to
external peripherals or loaded from external peripherals using the various methods with which Z32
communicates through the serial ports or through Ethernet network (see specific manuals).
2
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 - Files organization and structures
Important note for the execution of disk residing part-programs, for WinTerm and ZTerm user
interfaces:
When a part-program residing on disk is greater then 64KB, the program is executed directly
from the disk in DNC mode. For this reason, depending an the actual implementation, the user
interface may automatically create a "launcher file, calling the file to be executed in DNC mode.
Part programs smaller then 64KB are copied to the Z32 CMOS memory, and executed from the
CMOS (all necessary operations are automatically executed by the interface, completely
transparent to the operator).
CMOS files used by the user interface to create launcher programs (for files larger than 64kB),
or for the CMOS copy (programs smaller than 64kB), have the following default:
PROCESS 0 1 2 3 4 5
CMOS FILE USED 99 98 97 96 95 94
Different files may be used for special requirements.
The execution in DNC mode poses some limitations with respect to a direct execution from the
CMOS memory; for details about these differences, see the instruction !:L254 (DNC execution).
1.2.3 Part-program
To machine a part, all the relevant information must be supplied to Z32: this information
constitutes the PART-PROGRAM.
For correct interpretation information must be written in a LANGUAGE that Z32 understands.
D. ELECTRON 3
Chapter 1 - Files organization and structures CNC Z32 Programming Manual
A standard international program language exists (ISO standards) that defines a possible
standard language for programming numerical controls: these standards have unfortunately not
been up-dated for years and seriously limit the data processing possibilities of modern computers.
Most of the OPERATIVE instructions of the programming language of the Z32, that is these that
produce an immediate physical result on the machine tool (e.g. axes movements, execution of
auxiliary functions) are compatible with the ISO standard.
In addition to the ISO instructions the Z32 executes a number of EVOLVED and STRUCTURED
PROGRAMMING instructions which do not bring to an immediate physical effect on the tool
machine, but perform special functions such as calculation of expressions, jump to subprograms,
conditioning, etc.
To avoid confusion the programming lines can be only ISO or only evolved, or only of
structured programming, that is to say it is not possible to insert in the same line ISO and
EVOLVED and/or STRUCTURED PROGRAMMING instructions.
The evolved lines are different because, right after a line number (N) there is an exclamation
mark ! which opens the first field of the evolved line.
Structured programming lines are recognized by two consecutive leading - characters.
A part-program is made up of the following parts in this order:
a title (any title can be used but it must not contain the character %)
the character '%' (not mandatory)
the significant lines of the program can be either ISO, EVOLVED STRUCTURED
PROGRAMMING in no fixed order.
When the part-program is performed, the first 40 characters of the first line of the program
(which can contain a concise identification code) are displayed on the screen, to enable the
operator to immediately see that the program is running.
PART-PROGRAM
TITLE 1 or more lines without the percentage sign
%
N1 ...
.....
ISO or EVOLVED program lines
...
:OS possible local origins section
X1=...
...
:PA possible local parameters section
PP=...
...
:TL possible local tools section
T1#1...
...
4
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 - Files organization and structures
WARNING
The first line of a part-program cannot be a jump destination: this
limitation is more evident if the initial % is missing as the first line
becomes operative in every respect.
Automatic conversion into BLANK of any TAB characters contained in the part-program
Any "TAB" characters (ascii code 09) contained in the part-program can lead to CN errors of
various types (especially CN1D14 PROGRAM ERROR, but also CN2C14 INCOMPATIBLE
PARAMETERS, not easily understandable depending on the TAB positioning.
For this reason, "TAB" characters are automatically converted into "BLANK"
characters (space), better managed and recognised by the part-program interpreter.
D. ELECTRON 5
Chapter 1 - Files organization and structures CNC Z32 Programming Manual
block command is changed when the block is already processed but still not executed, the new
command will not be executed.
The buffer can contain about ten blocks.
Some of the Z32 functions empty the buffer before their execution. If one of these functions (e.g.
an M or a G4 dwell function) is programmed before the optional block, you will not have any
uncertainty.
Example:
...
N10 G0 X0 Y0
N11 G4 TT0 (dwell time equal to zero)
/N12 X10
...
As G4 function, at block N11, empties the buffer, the optional block command will be
immediately operating on block N12.
6
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 - Files organization and structures
:2
N20 T2 M6
N21 OX2 OY2 OZ2
...
It is not necessary to reprogram G37OL at the beginning of each section because it is in section
zero, which is always executed in block search procedure.
Lines belonging to another section can be recalled without causing problems.
Section The section number is not a parameter and it must be a complete number (without commas or
number decimal points).
The section number (programmed with : at the beginning of ISO line) cannot be greater than
99999.
The sections do not have to be numbered in progressive sequence, but this is recommended to
have more clearness.
Sectioning lines (those with a :) must not have the block number N (they must start with :)
Progres- Program sectioning zeroes the progressive number (block number).
sive An example of the structure of a program with sectioning follows. The rules to be followed for
number good results are very simple.
zeroing
In section zero (which is always read during step search procedure):
- enter valid information for entire program
- do not enter tool change instruction (it is not an error, but is not useful)
- enter a sectioning instruction before each tool change instruction
- remember to program all machining functions after each sectioning operation
SECTIONING TEST%
N1 G37OL G25XYZ OX1 OZ1
zero section information is always read during block search procedure
....
:1
N2 T1 M6
for certain types of tool change it is useful to anticipate the search of the next tool
N3 T2
...
all the machine program functions of tool T1 must be entered
N4 S100 M3 M41
:2
N20 T2 M6
the operator must confirm T because this is a new section
N21 T3
N22 S500 M3
N23 !GON6-N8!
lines N6-N8 belong to another section
N24 ...
In a sectioned program such as above, any beginning of section can be searched very quickly.
Example:
3 ENTER: :2
The CNC performs the following operations:
it reads and acquires the entire zero section
D. ELECTRON 7
Chapter 1 - Files organization and structures CNC Z32 Programming Manual
The ISO lines consist of a line number (not necessary) and a series of elementary instructions.
8
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 - Files organization and structures
The line number, apart from making the program more comprehensible, is used also as a jump
destination address.
The CNC can use it as a jump address, the line number must be exactly at the beginning of the
line, without intermediate spaces or characters. In some instances the line can be searched by
including the preceding characters (% or /).The sequence to be entered after GO must be
identical to the sequence of the characters at the beginning of the line to be searched. The decimal
point is considered a character different from a comma.
Examples:
N12 G41... is found with !GON12!
%N1G41... is found with !GO%N1!
/N12G41... is found with !GO/N12!
N132,5HA... is found with !GON132,5! not with !GON132.5!
N132.5M3... is found with !GON132.5! not with !GON132,5!
Some functions (e.g. the G110 to make a rough-machining macro) automatically create a line
number starting from the value of a parameter. In such instances, in order to be found:
- N must be at the beginning of the line without additional spaces or characters (%, /, //)
- any decimal points must be made with a full stop and not a comma
The line number 'N...' can be omitted: in this case the line cannot be considered destination for
the jump procedure.
D. ELECTRON 9
Chapter 1 - Files organization and structures CNC Z32 Programming Manual
There can be any number of spaces between the address and the numerical value.
There can be any number of spaces between the two elementary instructions.
Some elementary instruction can have, after the address, a combination of characters (see e.g.
origins) instead of a numerical value. After the numerical value they can have a descriptive tail
(see e.g. G25, G27, G28, G29).
ADDRESSES In accordance with ISO standards, addresses consist of a single letter of the alphabet, however,
as this is too restrictive, Z32 permits, as will be seen in the chapter dedicated to parameters,
addresses with one, two or three characters and some indexed vectors, i.e. PAR[ ], PAL[ ].
For example:
X normally assigned to axis X
M auxiliary function
MA auxiliary functions
F feed
PAR[ ] parameter with index
The addresses determine the particular type of operation to be performed by the CNC: some
addresses are defined by the manufacturer of the tool machine (e.g. axes names), others can be
defined by the end-user (user parameters), while others have pre-defined functions (system
parameters, etc.). The following are already defined:
G preparatory functions
M, MA, MB, MC auxiliary functions
F feed
S speed
O supplementary origins
T, TA, TB tool programmed, current, future
PAL [ ] parameter with index for communication with programmable logic
Numerous other addresses have specific meanings (see chapter on parameters)
To complete the elementary instruction, the addresses are followed by a numerical value.
NUMERICAL
VALUES Numerical values can be entered directly or, as will be seen more clearly in the relevant
paragraph, as a result of a mathematical EXPRESSION.
10
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 - Files organization and structures
When numerical values are entered directly they are programmed as numbers with a decimal
comma, with the following rules:
- at least one value must be programmed (zero is programmed with one or more figure
0)
- for numerical input, numbers with a maximum of 9 digits are accepted, before or after
the decimal point or comma (to be precise, the highest acceptable number is
1.000.000.009). Higher numbers produce program error CN1D14.
- the leading zeros may be omitted, even if there is a decimal part.
- either a comma , or a decimal point . can be used to separate the whole from the
decimal part
- here must be no characters or spaces inside the number
For example, to program 0,1 at address X the operator can program indifferently:
X.1
X .1
X,1
X0,1
X 0.1
X .100
X00000,1000
D. ELECTRON 11
Chapter 1 - Files organization and structures CNC Z32 Programming Manual
HA<(HX*2)/HY>
we obtain:
(HA<(HX*2)/HY>)
but this syntax is not allowed because the closing round bracket after HX*2 terminates the
comment. The execution of this line triggers the syntax error CN1D14.
In order to solve this problem, a very simple way to consider a whole line as a comment has
been introduced: just insert a ; (semicolon) character at line start, for example:
;HA<(HX*2)/HY>
in this case the whole line is considered as a comment.
12
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
CHAPTER 2
2. PREPARATORY G FUNCTIONS
2.1 G FUNCTIONS
G functions are known as preparatory functions insofar as they prepare the CNC to read
subsequent instructions.
The number that follows G identifies the particular function for which the Z32 is prepared. The
G0
value that follows G must always be a numerical value (it CANNOT be the result of an expression).
G00
The G is not a parameter.
Only some G functions (that is only some numerical values) are read and executed by the Z32.
When a G that is not implemented is programmed the Z32 gives an alarm.
The functions are those prescribed by ISO standards, with some adjustments.
In particular:
- the initial zeros of the G function can be omitted (G00 becomes G0)
- several G functions can be programmed in the same block: in this case the G functions
are recognized by the CNC and executed as they are encountered in the programmed
line. When several contrasting G functions have been programmed, the last G
programmed remains active.
- G functions can be followed by additional data, which complete their definition.
Modal G functions whose effect is maintained also in blocks subsequent to those in which they are
programmed are called MODAL. The modal G functions are normally cancelled by other special G
functions.
With Some Gs require the machine to be STOPPED; the contour must be completely defined when
stop they are executed. Therefore, neither a contouring command with open profile, nor a contouring
command with radius compensation, must be in progress.
These specific G functions are indicated later as WITH STOP. If these G functions are
programmed in a prohibited part of the path, the CNC gives an alarm.
Other functions (M, MA, MB, MC, T, O) require the stop, as can be seen more clearly in the
relevant paragraphs.
D. ELECTRON 13
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
programming alarm CN8414 - TOO MUCH AXES is triggered. Se si programmano oltre 5 assi con
G41/G42 o controllo del gap attivo viene allarme di tempo reale CN2813.
The speed, during movements in G0, is optimized to obtain maximum speed of movement,
without exceeding the speed defined for each moving axis.
If more than one axis is moving, the greatest speed is reach when at least one axis reaches its
maximum speed. The speed of the other axes is reduced proportionately to keep the movement
rectilinear.
For example: X and Y maximum speed = 10 m/min, Z maximum speed = 5 m/min, all axes at
initial position = zero:
N10 G0 X100 Y10 X=Y=10 m/min=14,142 m/min on path
N10 G0 X100 Z10 X=10 m/min, Z=1 m/min
N10 G0 X10 Z100 Z=5 m/min, X=0.5 m/min
14
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
WARNING
G1 can be programmed alone (without values) on one line, but it has a
special meaning (rectilinear movement OPEN, see chapter on contour
programming) and does not only mean to prepare for movement in G1.
For example:
...
N10 G1
N11 X0 Y0
...
is not allowed: at step 11 it gives error CN3414 PREVIOUS OPEN
2.1.5 G4 - dwell
Operative only on the block, with stop.
The duration of the dwell is equal to the value of the TT parameter, which can be programmed
in the same block or in a previous block. If from the beginning of the execution TT has not be
D. ELECTRON 15
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
programmed, the dwell time is zero. The TT parameter defines the dwell time in seconds and
decimals.
When performing the dwell the time may vary by about ten milliseconds because of the of the
cycle times of the microprocessor.
In order to obtain very low dwell times (TT) it is possible to activate the precise G4 dwell mode
with G113X. For further details, see the functions G200 HX11 / G200HX12.
Example:
...
N10 TT2.5
N11 G4 (DWELL OF 2.5 SECONDS)
...
16
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
K is the value of the node. It must be programmed in the first line and must not decrease during
the whole NURBS.
R is the weight. It is possible not to enter this value in the first and other lines. In this case 1 will
be the default value.
Functions with stop are not allowed during the NURBS (e.g auxiliary functions).
The K node must coincide for a number of lines equal to the P value (3 if P=3).
K is obligatory in the subsequent lines and must not decrease.
The NURBS is finished when a number of lines has been programmed that is equal to the P
value and only contain K without measures.
After the NURBS it is necessary to program the motion type (G0, G1 etc.).
During the NURBS, the G114 parameters influence the NC.
The geometrical accuracy of the path is better than RA (overshoot) divided by 2: if RA0.005 the
geometrical accuracy is 0.0025
If the NURBS contains edges (determined by coinciding nodes or measures), these will be
handled as G114 edges. The feed programming during a NURBS is acquired and effected as soon
as possible. This occurs at about the right point with a 4th-order NURBS (P4), delayed of about the
half of a block containing a 3rd-order NURBS (P3).
The delay between feed programming and its execution depends on the fact that with active
NURBSs there is no precise coincidence between a programmed motion and a machine motion, as
the machine motion is the effect of other programmed motions.
WARNING
Programming a G10 eliminates the jerk limit imposed by NTAR. See
calibration help function in global axis motion options.
In general, the G10 acts as follows:
- the final soft approaching phase is eliminated
- the positioning time (if existent) is eliminated
- it goes to the next step at a certain distance from the final point defined in the machine
settings which can exceed the positioning threshold.
The negative effects of the G10 are:
- possible overshooting of final point (axes can go beyond the programmed point when
acceleration is excessive)
- moving on to the next movement when the axes are still far from the programmed point
(some hundredths to some tenths of millimeter depending on the calibration). If the axes
remain alive during the next movement they are called back to the correct position: in
D. ELECTRON 17
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
normal conditions the axis returns within the machine accuracy limits within a few tenths
of a second.
Generally speaking G10 is not recommended when:
- going beyond the final point can be detrimental
- the precision of the positioned axes is immediately necessary (there is no time for
subsequent position recovery)
- one or more positioned axes are blocked (with G29) immediately after positioning (no
longer being alive, the axis is not recalled into position).
WARNING
If a line that is shortened or eliminated owing to radius compensation
contains a motion of the third axis, this motion it will be completed on the
next motion.
Example:
18
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
In this position a rotation around the edge is effected, that is not terminated as the tool diameter
is higher than the width of the pocket (tool diameter 20 mm, pocket width 15 mm).
All the subsequent motions in the program are eliminated up to the rotation around the last edge
N7 (X25) Y0.
Therefore, the tool centre motion consists of two incomplete revolutions, one around the first
edge and the other around the last edge, in order to position the tool against the pocket edges.
The N6 block containing the upward motion Z30 is eliminated, therefore the upward motion will
be effected with the next motion.
- arc (incomplete) around the edge X25 Y0 increasing the level measure from Z0 to Z30
- motion continued at Z30 up to the tool path end
Helixes The plain line upon which G12 acts can be either linear or circular, including the lines of
attachment to or separation from the profile (G41 and G42). When the line in the plane is circular, a
helical interpolation is performed.
Warning: the programming of a third axis on G2/G3 circle arcs is allowed without a previous
programming of G12. Further details in the paragraph "Contours on three axes" in the chapter
"Geometry".
As G12 limits the programming (slope, radius compensation, etc.) it must be entered only when
necessary and immediately cancelled when no longer required.
Example:
...
(WITHOUT RADIUS COMPENSATION)
N20 G0 X0 Y0 Z0 F1000
N21 G12 G2 X50 Y0 I25 J0 Z5 (HELIX)
N22 G1 X100 Z0 (INCLINED LINE)
N23 G13
...
(WITH RADIUS COMPENSATION)
N50 G0 X0 Y0 Z0
D. ELECTRON 19
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
N51 G12
N52 G41 X50 Y0 QF0 Z2 (HELICOIDAL CONNECTION)
N53 G1 X60 Z4 (INCLINED LINE)
N54 G13
N55 G2 X60 Y-10
N56 G40
...
20
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
- in addition to the programmed measures, the axis re-direction function is also active for the
axes defined by G25, G28, G29, G43, G44, KM, KD.
- the re-direction of axes is enabled for all the programmed motions, in work and rapid traverse
st nd
mode, yet the meaning of I and J, which are however associated with the 1 and 2 axes of the
triad, remains the same; the programming of G25 with re-directed axes resumes all the necessary
references.
D. ELECTRON 21
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The figures show some situations deriving from ISO 841: please note the difference between the
physical axis (direction of movement) and the geometrical axis (the ideal trace left by the tool on a
piece as a result of physical motion) when a piece moves. In this case the physical motion is
identified by the apex (X, Y, etc.).
Figure 1A shows the same machine as figure 1, with the same symbols and the same direction
of movement of the axes, but with the spindle vertical instead of horizontal. Please note how the
correct triad is G25ZXY. In the same way if machine 2 (made with vertical head) is transformed to
horizontal, the correct triad is still G25ZXY.
Should an incorrect triad be entered (e.g. the first and second axes of the plane inverted), the
Z32 cannot detect the error (which may not be an error if one imagines a spindle that works from
below) and executes the movements that would be correct for a machine with inverted axes.
The operator will see inverted circular movements (G2/G3 and G41/G42).
Example:
...
(HERE G25XYZ IS ACTIVE)
N10 G0 X0 Y0 Z0
N11 B0
N12 G25BYZ
N13 G2 B30 Y0 I15 J0
N14 G25XYZ
...
22
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 23
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
Up to 13 Up to 13 axes can be alive simultaneously, but each alive axis requires supplementary
live axes computation to the microprocessor, which may not be compatible with very complex system
configurations. It is therefore advisable to keep constantly alive only the axes really necessary.
When the system takes control of a previously inactive axis, the Z32 acquires the present
position the axis, without giving an alarm, if the axis had been moved from the last positioning. This
makes it possible to:
1) lead an axis to a position and abandon it
2) move the axis by means other than CNC (manually, with PLC or other automatism)
3) take the axis under control again from the actual position without errors occurring.
Please note that the axis position parameter is not preset by G28, even if the axis was previously
abandoned. The acquisition of the axes positions in the relevant parameters if performed
exclusively with G105 (see relevant paragraphs).
The axis is activated prior to any axis motions contained in the line. Example (machine with XYZ
alive and B not alive):
...
N10 G0 X0 Y0 Z0 F300
N11 G28B B0
N12 G1 Z-10
N13 Y50 B50 G29B
...
In the case of cyclic axes, some peculiarities must be borne in mind. Please see the paragraph
Cyclical Continuous Axes in the chapter on Special Performances.
For the management of SCARA axes, the G28 function behaves in a special way because both
the two physical axes and the two fictitious axes are made active and inactive together (see M95
user manual, chapter on alarms CN..13).
24
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
The CN3A14 AXIS NOT ALIVE alarm will appear only if one tries to program a disabled axis
while G98 is active.
If a disabled axis is programmed, and this axis is already within the position threshold defined in
the machine settings, the programmed movement is ignored and the superfluous lock/unlock cycle
is not produced, thereby saving considerable time.
Naturally if the axis is alive any movement is performed, even if shorter in length than the
positioning threshold.
The lock/unlock cycle is however generated if the disabled axis is one of the three of the triad
currently active, but this is most unusual: typically the axes of the triad are in fact always active.
Should the origin be programmed on the same line as the movement of the disabled axis, for
example:
G29B ... (axis B is "dead")
OB1 B0
the execution of the lock/unlock cycle of the axis itself will be forced.
This means that, if the origin is entered in the same line as the programmed movement, there
will always be a lock/unlock cycle on the axis, even if the axis is already in position and remains still.
If the programmer wants to eliminate this cycle he will have to split the line in two and program the
origin in a previous line.
If a disabled axis is programmed in the same line with G53 or G54.
For example:
N100 G53 B10 X20 (B is a dead axis)
The dead axis is made alive even if the movement is null.
D. ELECTRON 25
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
One axis only of those defined as continuous by machine settings must be specified.
If the operator wants to make more than one axis inactive, he should enter the G29 instruction
several times in the same line or in different ones. e.g. G29XG29A to abandon axes X and A.
The request to make an idle axis inactive is allowed, but it does not produce any result.
Axis deactivation is performed after any axis movements included in the line.
See the example for G28.
26
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
The G33 instruction cancels G0, G94 (mm/min), G95 (mm/revolution) and G96 /m/min); it
activates G1.
G33 is made inactive by G0, G93, G94, G95 and G96. If it is cancelled by G0, the G95
(mm/revolution) function will automatically remain active.
If the first movement of thread cutting is circular, the operator needs to enter G33G2 or G33G3.
Note that G33 must come before G2/G3 in the line: if G2 or G3 are edited before G33 (G2G33) they
are cancelled by G33 which forces G1.
No functions requiring stopping can be programmed if G33 is operating (i.e. all the auxiliary
functions M, MA, MB, MC, S, G4, etc.). If one of these functions is programmed with G33 or
operating, the CNC will display the alarm message CN3C14 G33, G34, G35 or G63 ACTIVE
When programming G28 or G29, or the motion of a dead axis (which should be therefore
enabled and then disabled) the following alarm message is released:
CN6214 LIVE AXES CHANGE + G33/G34/G35/G63
When G33 is operating (as for G84), the progressive number will not be increased: the block
search procedure with progressive number will only find the first block in G33.
During G33 the following are not active:
- axes override
- spindle override
- single block
Thread cutting can be made in circular or rectilinear segments or on the plane, regardless of
their orientation.
The K parameter identifies the thread-cutting pitch, which can be programmed in the block or in
previous ones.
K pitch K determines the pitch along the axis thread and represents the distance between two threads.
If the thread cutting is conic, the pitch along the longitudinal axis will be shorter because of the
inclination.
During G33, the velocity feed-forward will be operating (Z32 normal mode, in which there is no
error proportional to the velocity). Though the spindle varies its speed, there are few errors. We
suggest keeping the spindle speed constant during thread operation for a perfect thread cutting
finish.
Several thread-cutting movements can be performed in succession: the thread pitch will be kept
constant, unless the operator asks for accelerations or speeds higher than those allowed by
machine settings. In this case, speed and accelerations are reduced and the pitch is temporarily
lost. It will be recovered as soon as movements are compatible with the machine settings.
Immediate The first thread is synchronized when the spindle passes through zero position. It is possible to
lock perform deep thread cutting by multiple passes with thread re-entering.
Multiple thread cutting is possible by moving the starting point.
Example:
...
N10 G0 X0 Z0
N11 G33 Z-100 K2.5
...
Ingress in G33 (threading), or linking to the first synchronized thread with the spindle going
through the zero, is soft. This occurs without having to extend the thread ingress phase thanks to a
calculated advance applied to the linear axis entering threading mode.
D. ELECTRON 27
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
It is furthermore possible to define the G33 approach time in machine setup, i.e. the initial
acceleration ramp when the threading starts. For this feature, please refer to the machine tool
builder specifications.
Example 1:
G0 X0 Y0 Z0
28
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
M3 S200
G34 K2 I0.5 Z30 threading with rising pitch of 0.5 mm/round starting from
the initial pitch 2 up to Z30
G33 Z50 threading with pitch equal to that reached in the preceding
block, up to Z50, sets pitch increment = 0
G35 Z70 threading with decreasing pitch, but the behavior is the
same of a fixed pitch threading, because the I parameter
has not been programmed after G33
Example 2:
G0 X0 Y0 Z0
M3 S200
G34 K2 I0.5 Z30 threading with rising pitch of 0.5 mm/round starting from
the initial pitch 2 up to Z30
G33 Z50 threading with pitch equal to that reached in the preceding
block, up to Z50, sets pitch increment = 0
G35 Z70 I0.25 threading with decreasing pitch of 0.25 mm/round, starting
from the pitch of preceding block, up to Z70
Example 3:
G0 X0 Y0 Z0
M3 S200
G34 K2 I0.5 Z30 threading with rising pitch of 0.5 mm/round starting from
the initial pitch 2 up to Z30
G33 Z50 K3 threading with pitch 3 up to Z50 WARNING: if the final pitch
of preceding block is different from 3, an abrupt pitch
variation is encountered
G35 Z70 I0.25 threading with decreasing pitch of 0.25 mm/round, starting
from the pitch of preceding block, up to Z70
Example 4:
G0 X0 Y0 Z0
M3 S200
G34 I0.5
K5 Z30 threading with rising pitch of 0.5 mm/round starting from
the initial pitch 5 up to Z30
G35 Z60 threading with increasing pitch of 0.5 mm/round, starting
form the final pitch of preceding block, up to Z60 (switching
from G34 to G35, the same I increment of 0.5 is
maintained)
Example 5:
G0 X0 Y0
M3 S200
G34 I0.9
K5 Z50 threading with rising pitch of 0.9 mm/round starting from
the initial pitch 5 up to Z50
D. ELECTRON 29
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G35 Z60 K4 I0.8 threading with decreasing pitch of 0.8 mm/round, starting
from pitch 4 up to Z60. WARNING: big pitch change,
because the final pitch of preceding block is certainly not 4.
G36*
G36* asks the CNC to force the progressive number of the operation (that used in block search
procedure) to the following value.
Active only in the block.
After G36* the operator must enter the 8 digit number (max 16777216) he wants to insert in the
progressive number. Leading zeroes can be omitted.
For example:
G36 * 200
forces the progressive number to the value of 200.
This can be useful when there are cyclic programs, which never find M2, because at the end of
the program there is a jump without return to the beginning, e.g.:
CONTINUOUS PROGRAM%
N1 G36*0
N2 ...
...
N100 M0 (CHANGE WORK PIECE AND PRESS START)
N101 !GON1!
By means of this program a continuous working cycle is set up: the operator must change the
workpiece at the end of the program and press START to perform the machining of a new
workpiece. If there were no G36* next to the N1 instruction, the progressive number would increase
indefinitely, to make any block search procedure impossible. With G36*C instead the progressive
number starts from zero and a single step search procedure can be performed normally.
G36H/G36S halt/start
G36H and G36S ask the CNC to stop (H) and start (S) counting progressive numbers again.
Modal. G36S is active at reset.
These are useful when the operator does not want to disturb the regular increasing of the
progressive number, for operations depending on contingent machine situation, or when the
operator does not want to authorize the single block search procedure inside a sequence of
operations.
30
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
During the execution of special M functions or canned system cycles, the progressive number is
automatically stopped at the initial value (this is equivalent to a G36H operation at the beginning of
the sub-program and a G36S operation at the end of the sub-program). A single block search
procedure is, therefore, not possible inside special M functions, nor inside canned system cycles.
Example:
...
N10 G0 X0 Y0 Z0 F1000
N11 M70 probe measuring cycle
N12 !IF AM<9000 ;GON16!
N13 G36H from this point the progressive number will not change
N14 T<T>M6 tool change searched for replacement tool
N15 G36S counting starts again
N16 ... the progressive number is always the same here
...
G36R/G36W read/write
G36R/G36W ask the CNC to read the progressive number in the HX parameter and to write in
the progressive number the content of the HX parameter.
Active only in the block, with stop.
Allow the progressive number manipulation, useful in case of repeated operations.
These are to be used by the manufacturer of the tool machine or very skilled programmers. The
example is to be considered as exclusively didactic.
The machine has a control device for the integrity of the tool during machining, which is
connected to the PLC, that permits movements to be performed in G62. If a worn tool is detected
during movement the tool must be changed and movement must be repeated without changing the
normal flow of the progressive number.
...
N20 G0 X0 Y0 Z0
N21 G1 G62 F1000 Z-20
N22 !IF AM<9000 ;GON26!
... here tool is changed and operation repeated
N23 G36H Z100 T<T> M6 replacement tool
N24 G36R HX<HX-2> G36W G36S resets the old number
N25 !GON20! repeats operations
N26 ...
D. ELECTRON 31
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
32
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 33
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
34
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 35
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
36
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 37
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
During G63 the overrides (axes and spindle) and feed-hold are not operating. Reset and stop
controls are operating but can be disabled if the manufacturer of the tool machine considers it
necessary.
The machine needs to be prearranged as follows allow the G63:
- position transducer on the spindle must be connected to the CNC.
- spindle reversing and steady spindle speed detection must be managed by the PLC.
It is suggested that the manufacturer supplies a canned cycle for synchronized tapping that
manages all the auxiliary functions pertaining to the spindle.
The following error (first in one direction and then in the other) present when G113P is enabled
(soft movements) is not compatible with synchronized tapping.
Soft movements are automatically discontinued during synchronized tapping.
Ingress in G63 (synchronized tapping), that is moving to the first synchronized thread with the
spindle going through the zero, is soft. This occurs without having to extend the thread ingress
phase thanks to a calculated advance applied to the linear axis entering synchronized tapping
mode.
It is furthermore possible to define the G63 approach time in machine setup, i.e. the initial
acceleration ramp when the rigid tapping starts. For this feature, please refer to the machine tool
builder specifications.
38
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
chamfers (RB)
rotating centers (IR, JR)
mirror axes centers (IS, JS)
feed (F)
additional factors on linear axes positions (KDX, KDY, KDZ, )
DM parameter (distance to go in feed during a G61 movement)
- After activating the forced behavior, the following values are NOT modified:
tool lengths (L, LX, LZ)
tool radius (R)
origin valeus
In this mode, tool tables and origin tables maintain their validity (and referred to the measuring
unit expressed in setup) independently from the mode in use.
- Feed management
Let us assume a millimeter machine forced in inches with G70.
-> Before the G71, the feed is expressed in mm/min (normal operation)
-> After the G70, the programmed feed is expressed in inches/min
-> If the feed is not programmed anew after the G70, the preceding feed remains active.
Example:
F1000 (in mm/min)
G1 ...
...
G70 (machine forced in inches)
G1 X... Y... (here the feed remains 1000 mm/min)
...
F100 (programmed feed after G70, i.e. 100 inches/min)
The G70/G71 functions are compatible with head and table RTCP and with G116 roto-
translations, taking into account the following:
-> the X Y Z translation parameters of the G116 function must be expressed in
inches/millimeter depending on G70/G71 programming.
-> the I J K X Y Z parameters of the G118 function must be expressed in inches/millimeter
depending of G70/G71 programming
-> the I J K parameters of the G117 function must be expressed in inches/millimeter depending
of G70/G71 programming
-> the I J K parameters of the G120 function must be expressed in inches/millimeter depending
of G70/G71 programming
-> the I J K parameters of the G122 function must be expressed in inches/millimeter depending
of G70/G71 programming
- The G105 function returns the positions expressed in inches/millimeters depending on G70
programming (positions returned in inches) or G71 programming (positions returned in millimeter)
- The I RA parameters of the G114 function must be expressed in inches/millimeter depending
of G70/G71 programming
D. ELECTRON 39
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
- The G61 and G62 functions returns positions expressed in inches/millimeter according to the
G70/G71 mode in use
- All positions of motion blocks defined through NURBS (G6.2) must be expressed in
inches/millimeter depending on G70/G71 programming
- The G123 function is compatible with the G70/G71 functions; the values associated with linear
axes must be expressed in inches/millimeter depending on the G70/G71 programming.
- G70/G71 and special M
When a special M code is called inside a forced programming section (G70/G71), the program
associated with the special M is entered with the setup condition restored. At the exit of the special
M code, the forced condition in use before the calling is restored.
Let us assume a millimeter machine forced in inches with G70.
...
G70 (forces inches programming)
...
M63
[-> M63 subprogram automatically executed in millimeter]
[-> all subprograms possibly called by the M63 program are also executed in millimeter]
[-> return to the main program and automatic restore of the inches programming]
Note: ALL programs possibly called by the subprogram associated with M63 will be also
executed in millimeter mode. For example, if the M63 code contains a !GOP1! instruction, the
program 1 is executed in millimeter. The inches programming is only restored at the end of
execution of the M63 code.
WARNING: inside a special M code it is not possible to program G70/G71 functions. Otherwise
the error CN8914 G70/G71 + SYSTEM FIXED CYCLE OR G800/G900 is triggered.
- G70/G71 and G27C fixed cycles
During forced mode operation (for example, millimeter machine forced in inches) it is not
allowed to call system fixed cycles (G27C1... G27C30), otherwise the error CN8914 G70/G71 +
SYSTEM FIXED CYCLE OR G800/G900 is triggered.
The calling of user fixed cycles, starting from G27C31 are instead allowed.
WARNING: inside a system fixed cycle (G27C1...G27C30) it is NOT possible to program
G70/G71 functions. Otherwise the error CN8914 G70/G71 + SYSTEM FIXED CYCLE OR
G800/G900 is triggered.
- G70/G71 and G800/G900 functions
During forced mode operation (for example, millimeter machine forced in inches) it is not
allowed to call fixed cycles or macros with the G800/G900 functions, otherwise the error CN8914
G70/G71 + SYSTEM FIXED CYCLE OR G800/G900 is triggered.
WARNING: inside a fixed cycle or macro G800/G900 it is NOT possible to program G70/G71
functions. Otherwise the error CN8914 G70/G71 + SYSTEM FIXED CYCLE OR G800/G900 is
triggered.
- G70/G71 and measure display
During forced mode operation (for example millimeter machine forced in inches) the below
indicated values are displayed in the forced measuring unit, i.e. a millimeter machine displays the
values in inches if G70 is programmed (inches programming).
- axes positions
- axes errors
40
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
- axes distances
- interpolated distance
- actual feed
- programmed feed
- G70/G71 and Z32 activity
The G70/G71 forcing can be activated in activity 1 (Automatic), 12 (Semiautomatic or MDI), 3
(Block search).
In activity 4 (JOG) the G70/G71 programming has no effect but it is not disabled; two examples
to clarify the question:
Example 1: (machine defined in mm in setup)
- automatic launch of a part program forcing inches programming
- abort the part-program execution with STOP pushbutton, after the forcing has been activated
- press ESC
- enter JOG mode; at this point the forcing has no more effect (suspended)
- all JOG movements are executed without any forcing
- return in automatic (forcing restored)
- resume part-program execution with the forcing active
Example 2: (machine defined in mm in setup)
- program inches forcing in semiautomatic
- execution of axes movements affected by the forcing
- press ESC
- enter JOG mode; at this point the forcing has no more effect (suspended)
- all JOG movements are executed without any forcing
- return in semiautomatic (forcing restored)
- all subsequent movements will be again affected by the forcing
The G70/G71 forcing is canceled entering the activity 7 (axes zero), activity 8 (axes motion with
velocity loop), activity 11 (auto tuning)
D. ELECTRON 41
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
42
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 43
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
This restriction is not important, because incremental programming is useful only for
computerized part-programming.
The limitation does not apply to sub-programs and user canned cycles: if necessary, the
programmer will insert a G90.
Example:
N1 G0 X0 Y0 (rapid traverse)
N2 G93 F1000 (G93 enabled, time 1/1000 min.)
N3 G1 X0.5 (500 mm/min)
N4 Y2 (2000 mm/min)
N5 X0 Y0 (2061.5 mm/min)
N6 G0 X10 Y10 (rapid traverse)
Rules:
- there is no control of the programmed feed and of the length of the segment programmed: if
the segment length is zero, a zero feed will result
- nothing changes if axes are measured in inch: the function of G93 is that of entering the
inverse time within which the subsequent segments have to be executed
- G93 cancels G94, G95, G33 and G131 and is cancelled by G94, G95 e G131.
- G53 immediately cancels G93 and resumes G94 (programming in mm/min or unit/min)
44
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 45
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
There is an option (to be included in the machine settings) that allows a JOG to be performed
when G95 (feed in mm/revolution) or G96 (speed in m/min) are enabled.
When this option is selected, there are two results:
- G94 (mm/mm) or G97 is not forced during the jog movement
- if a programmed F is active (for example, when passing from MDI to JOG without
resetting), the programmed feed is used as the JOG feed instead of the default feed.
This is particularly useful in the case of lathes, but can be valid for milling machines as well. In
that case it will be significant only as regards the second effect, that is, jog feed equal to
programmed feed, if any. For this feature, please refer to the machine tool builder specifications.
46
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 47
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
Example:
N10 AU348.99 G100 (IT PUTS THE VALUE 0348 TO AU)
...
Z32 provides another way of exchanging data between PLC and part-program: the PAL[ ]
parameters. Please refer to paragraph Parameters with Index in the chapter on Parameters.
Reserved for This G function is useful in programming general-purpose sub-programs, when the operator
the wants to modify the state of the program and then restore the previous one, without knowing what it
manufacturer was. For example, inside a canned cycle, it is possible:
- to save the status with G102.
- to activate local origin and parameter sections.
- to use and modify local origins and parameters.
- to reset the sections operating prior to the canned cycle.
48
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
We suggest using G102 and G103 instructions only if the operator is an experienced
programmer.
See G103 instruction, for the examples.
WARNING:
The programmer should ensure that only one G103 corresponds to each
G102 and that it is not possible, e.g. due to programs running as a result
of conditional jumps, to skip a G103 or perform one too many. The next
G103s would reset states different from those desired, with unforeseeable
consequences.
We recommend that the programmer of canned system cycles and sub-programs associated to
special Ms, should not use G53/G54 to interrupt and then reactivate compensations, but to use
G102 followed by G53 at the beginning of the sub-program and G103 at the end of the program to
restore status. This avoids problems if a special sub-programs is called by another special sub-
programs.
There are in memory only two data concerning G53 status: one for the normal status (user) and
one for the special status (manufacturer): any G54 in the special sub-program called back, would
cancel the G53 of the special calling sub-program. In the following example, a drilling canned cycle,
with computation of the holes done, is described:
DRILLING CANNED CYCLE
%
N1 G102
...(NORMAL CANNED CYCLE)
N80 G37PL
N81 !:RPN1=HA!HA=HA+1!:WPN1=HA!
N82 G103 G26
Please note that the previous status restoring, operated by G103, does not mean a previous
origin and length reset: the names of the origins and the value of L parameter will be the same.
When G103 is executed, the L parameter is considered as programmed, and all the origins will
be calculated again, only if there is a change in the status of the origins (G53/54) or of the length
(G43/44/45). In the example we describe some situations, which rarely occur in practice, but useful
to better understand the theory:
...
N8 G0 G54 G43Z G37OG OX0 OY0 OZ0
N8,5 L0 X0 Y0 Z0 all axes at zero position: there are no origins nor lengths.
D. ELECTRON 49
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
50
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
At reset, all the parameters are set to zero, except the parameters pertaining to axes
dimensions, that are initialized with the actual positions at reset (it is equivalent to programming of
G105 at program start).
After programming an axis in an ISO line, the value of the axis parameter is the same as the real
position, except for positioning errors, because the CNC mechanically moves the axis to the
programmed position.
After origin programming, the values displayed change, but not the parameters, so they are no
longer representative of the physical position.
The same situation occurs for any function which changes origins or compensations (G53/G54,
L, etc.)
With G105 function the measured positions (referred to origin and compensation currently
active) are transferred to the axis position parameters (for all the continuous axes including idle
ones).
Example of how physical position and relevant parameters evolve:
PROGRAM physical position X parameter
% +250 +250
G105 +250 +250
G0 X10 +10 +10
OX1 (+300 from the base origin) -290 +10
G105 -290 -290
X<X> -290 -290
WARNING
The position transferred is the real measured position, not the
programmed one. These two positions may be different due to positioning
errors (which, however, must be very small to remain within the position
threshold).
For example, if the operator enters X10, and the axis reaches the position 9,998, G105 will
acquire the position 9,998 and not position 10.
For cyclic axes see chapter on Special Performances, paragraph Continuous Cyclic Axes.
D. ELECTRON 51
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
52
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
G109 instruction is followed by a letter which personalizes the radius compensation (see chapter
on Tool Radius Compensation).
G109U G109V
G109U and G109V are used to modify feedrate control during radius compensation.
When in radius compensation mode, Z32 tends to maintain machining speed constant at the
contact point between the tool and the programmed profile.
If the profile contains an internal arc, the tool centre (if the radius is positive!) follows an arc that
is narrower than the programmed arc. If the tool centre feedrate was kept constant, excessive feed
would occur on the periphery.
Therefore, in these cases, Z32 decreases the speed of the tool centre automatically.
This automatism may be incorrect if the radius is actually fictitious, that is, if it does not represent
the real radius (this is the case when a CAM calculates the path of the toroid tool centre in advance
and the R radius set in the CNC only represents the minus or plus variation with respect to the
theoretical radius).
G109U eliminates Feedrate Optimization by the CNC and forces Uniform Feedrate mode.
G109V (active at reset) restores the feedrate optimization during radius compensation mode.
G109X
G109X is used in some particular cases of closed profile.
When the Z32 is in radius compensation mode, it looks ahead to some segments on the profile
(from 3 with G109A to 7 with G109E) and eliminates intermediate segments if the tool interferes.
In the case of closed profiles made of a small number of segments (less than the number of
those explored in advance) the CNC may decide that there is an interference between the last and
the first segment and may therefore cancel the whole profile.
If programmed at an intermediary point on a profile, G109X forces the CNC to acquire all the
programmed segments that are geometrically closed: if it is programmed at an intermediate point
on a closed profile, it prevents interference checks between the first and the last segment thus
preventing the profile from being cancelled.
G109R G109N
Furthermore, it is possible to program:
G109R to radius the inner angle
G109N to cancel G109R
By radiusing an inner angle, it is possible to examine and solve problems related to the error
CN2B14 INCOMPATIBLE PROFILE.
D. ELECTRON 53
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G109R can be programmed immediately before the blocks which produce the error situation,
thereby easing analysis and correction.
G109S G109T
G113A or G113B are used for determining the curvilinear profile of a point-by-point path, or with
an indefinite sequence of linear segments.
As specified in the high-speed control manual, an arc breaks the sequence of radiusing
segments.
Normally, the CAM system keeps into account the size of the tool in the development of the
point-by-point program, and therefore it is not necessary to use radius compensation on the NC.
Sometimes, in the case of flat profiles, the operator may want to use the Z32 radius
compensation function in order to adapt the profile to a worn-out tool without having to generate
another profile on the CAM system.
On internal edges, G113A or G113B and high speed continue to operate correctly, however on
internal edges the radius compensation system introduces linkage arcs to obtain the rotation of the
tool around the edges as a result impeding the determination of the curve, and therefore leading to
sizeable slow-downs.
With G109S it is possible to force the Z32 radius compensation system in order to avoid the
generation of arcs and extend the segment up to the bisecting line of the edge. This ensures the
correct functioning of G113A or G113B and avoids any slow-down.
G109S (modal, not active on reset) forces the correction on the bisecting line, while G109T
(modal, active on reset) restores the normal operation of Z32 with the introduction of linkage arc.
As G109S id modal, it can be programmed only once at the beginning of the program, for
example:
The extension of the path up to the bisecting line may provoke an excessive lengthening of the
segment, which is undesirable in the case of sharp edges. For example, in the extreme case of a
180 edge, the path extension would be infinite.
Considered that in the case of sharp edges, G113A or G113B will not insert any connection
radius, and in order to avoid undesired path deviations, G109S is only effective on edges with
angles inferior to 16. In case of wider angles, the standard linkage arc function is introduced, as a
result keeping the path around the edge within safe limits.
G109Y
54
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 55
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
General remarks
G110 macrofunctions allow the creation of rough-machining macros.
G110 is commonly used by macro designers; when programming a piece the macro is provided
with a few parameters defining the profile, the pass slope and the cut increment.
The macro will use the G110 macrofunctions to define intersection points, cuts, fast returns, etc.
Generally, G110 is programmed according to the following syntax:
G110TxPy or G110Tz where:
x (from 0 to 6): is a macrofunction identifier
y (from 0 to 2): is a program identifier
z (3 or 4): is a macrofunction identifier
The codes have the following meanings:
T0: FIRST POINT on a profile
T1: ANALYSIS of a profile
T2: CONTOUR on a profile
T3: stops displaying blocks
T4: resumes displaying blocks
T5: calculates the DIMENSIONS of a profile at a given pre-length
T6: ANALYSIS with multiple intersections
T7: contouring on a profile up to a predefined length
T8: geometrical analysis of the profile
P0: the profile is in the same program that contains G110
P1: the profile is in the calling program (this is a typical case)
P2: the profile is in the second calling program
P, program identifier
The P to be used depends on the architecture of the programs in which G110 is inserted:
P0 The profile and G110 are in the same program. This will not be the normal use of G110 as
the programmer will hardly want to include a roughing macro in his program. It may be of help in
simplified tests.
P1 This is the normal case: the profile is contained in the program that called the macro (that
contains G110). The program structure is as follows:
the roughing macro is contained in a special M subroutine
the part-program contains the profile
the roughing is obtained by providing the necessary parameters to the special M (usually
first and last line number, slope and cut increment)
P2 The program containing the profile does not call the subroutine containing G110 directly, but
uses an intermediate subroutine to do this. This could be useful in the case of complex
architectures.
Pre-lengths
AN AP
Pre-length parameters are used G110 both in input and output.
Pre-length means the distance covered by the tool centre from the beginning of the profile to the
specified point.
This is a simple and univocal way of identifying any point on a profile.
56
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 57
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
At input to G110, it is contained in the HR parameter. It represents the distance of the cutting
line from a conventional point (it is the current origin).
The height of the cutting line refers to the current origin (the cutting line with 0 height goes
through the current origin). This allows the height of the cutting line even to be defined without
having programmed G110T0 to read its initial value.
Otherwise, the macro programmer will have the possibility of not programming the real numeric
value of HR: he will be able to include increment and decrement operations with regard to the initial
value that is output by the first-point macro function (G110T0).
In particular, by programming HR = HR + K the straight cut line is displaced by a distance equal
to the increment.
Profile limitations
There are no particular limitations to the number nor types of profile segments contained
between the first and the last line: a longer profile will just require more time to be processed.
Every time G110 is called, the specified profile is always completely executed, even when the axes
movement is only partial or null (it is a sort of block search). Therefore, at the end of G110, the status of
the Z32 ( parameters and other modal functions) is modified according to the contents of the profile.
Consequently, the profile must be completely defined and be repeatable many times without
requiring any special initialization. In particular:
- the first profile section cannot be G2/G3 (as the initial point is not always the same); G0
is better
- the final segment must be closed
- it is better if the parametrical data in the profile, if any, be initialized in the profile itself: If
data contained in non-initialized parameters are used, make sure that these data are not
modified at the end of the profile.
- Rototraslation, mirroring and scale factors can be used as long as they are enabled
within the profile and disabled before the end. For greater certainty, the programmer of
the macro should force a cancellation.
Because of internal macro organization requirements, the following limitations also apply:
- movements beyond the working plane are not admitted
- the working triad cannot be programmed within the profile.
Technical specifications
58
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
Remarks:
- only the final points of the profile segments are taken into account: intersection with any
circular sections contained in the profile is not calculated.
- No movement is generated.
Analysis, G110T1
Call: G110T1Py (y = 0, 1, 2)
Function: searches on the specified profile, starting from the specified pre-length, the first
negative intersection and the next positive one with the straight cut line (positive intersection
meaning that the profile crosses the straight cut line in the some direction as the increment).
Input parameters:
HX HY first and last line number
HT angle of the cutting line
HR height of the cutting line
K cut increment
AN initial pre-length
Output parameters
AN pre-length of the negative intersection (-1 if not found)
HX HY dimensions of neg. intersection (HX 1st axis, HY is the 2nd axis)
AP pre-length of the positive intersection (-1 if not found)
HR HT dimensions of pos. intersection (HR 1st axis, HT is the 2nd axis)
Remarks:
- if the first positive intersection and the next negative one must be known, the K sign at
input must be inverted.
- if other intersections exist before the initial AN pre-length, these are not taken into
consideration
- the intersections can fall on an intermediate point of the profile sections.
- should the profile point corresponding to the pre-length input be already negative with
respect to the cutting line, G110 gives that the first negative intersection coincides with the
initial point.
- no axis movement is generated
Contour, G110T2
Call: G110T2Py (y = 0, 1, 2)
Function: executes the profile comprised between the initial pre-length and the first positive
intersection with the cutting line.
Input parameters:
HX HY first and last line number
HT angle of the cutting line
HR height of the cutting line
K cut increment
AN initial pre-length
Output parameters:
AN positive intersection pre-length (-1 if not found)
Remarks:
- if no intersection is found, the profile is executed from the initial pre-length to the end
D. ELECTRON 59
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
In G110T2, if G114 is active, there is no slow down at the end of each section.
To simplify internal calculations, the profile performed using G110T2 (contour) does not feature
continuous speed as it would if it were performed directly.
There is a strong slow down at the end of each elementary section making the profile.
This slow-down does not occur if G114 is active: in this case the part of the profile executed
using G110T2 has the same speed as if it were performed directly.
Please note that G114 is not compatible with G95 (cutting speed in mm/rotation), therefore this
performance is hardly significant for lathes that mainly use G95.
Dimensions, G110T5
60
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
In the following description, profile is used to indicate the course of the tool centre. If radius
compensation is not active the course of the tool centre and the programmed profile coincide, while
this is not true if radius compensation is active.
Function: it calculates the dimensions of a point of a profile at a given pre-length. It is similar to
G110T1 (analysis), but has different input (the cutting line is not necessary) and output (the profile
dimensions are provided) parameters.
Input parameters (they need not be programmed in the same line):
AN pre-length at which the dimensions must be calculated
HX number of the initial line (the same as with G110T1)
HY number of the last line (the same as with G110T1)
Output parameters:
AN gives >= 0 (typically 0) if < than the total length of the profile, -1 if input AN value
was > the total length of the profile
HR, HT dimensions of point on the profile. If AN on output is -1, these are the
dimensions of the last point of the profile.
AP, HX, HY not significant
D. ELECTRON 61
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G110T7
Contouring on a profile up to a predefined length (reserved to D.Electron).
G110T8
Geometrical analysis of the profile (reserved to D.Electron).
Practical recommendations
G110 allows the creation of even very complex roughing macros.
However, the designer should take into account some aspects of the use of G110 that are not
always clear at the beginning in order to avoid problems in the case of profiles featuring extreme
geometric situations.
Calculation precision
The calculations performed by Z32 to determine the intersections of the cutting line with the
analyzed profile are all floating point calculations, with 31-bit accuracy (8 decimal digits). Calculation
errors accumulated during the various phases do not normally exceed one micron.
Analysis from the profile beginning with an already negative initial point
The analysis of a profile can begin from any point: when entering the macro the AN parameter
specifies the quantity of profile that must be discarded before performing the analysis. If the initial
point of the analyzed profile is already negative, this initial point is taken as first negative
intersection.
This will avoid problems should the cutting line intersect the profile exactly at the end of a
segment: calculation approximation may indeed insert the cutting line in a profile interruption and
the intersection may not be found.
This forcing must be taken into account when making logical decisions.
62
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
In the example shown in the figure, to find the N2 and P2 intersections, we can program:
AN0 HX10 HY20 HR... HT30 K8 G110T1P1 (1st analysis)
AN<AP+.002> HX10 HY20 HR... HT30 K8 G110T1P1 (2nd analysis)
If AN = AP is programmed in the second analysis, two different and unforeseeable results may
appear depending on the calculation approximations:
- the N1/P1 intersections are found
- the N2/P2 intersections are found
Execution time
The execution time of G110 depends on the length of the profile: in practice, every G110
explores the profile completely, and performs intersection calculations that may last from 0.1 to
about 15 milliseconds for each profile section.
The execution time of a complete macro is the sum of the times required by the instructions it
contains: the G110 and the other instructions. If the profile is complex, a large number of additional
analyses may be required to distinguish multiple intersections, thus making execution time longer.
D. ELECTRON 63
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
WARNING:
Because of the buffer of pre-processed blocks in the memory, the effect of
G113H/L occurs before the point where it is programmed. The entity of the
advance cannot be foreseen (currently, it amounts to about ten blocks and
is likely to vary later if the buffer memory is increased). If it is necessary to
be certain when G113H/L will occur, a stop function must be
programmed beforehand, the most harmless being G4 (delay) TT0.
If the whole program must be run with fast interpolation, a G113H at the beginning is sufficient.
64
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
- The X MODE combines the high accuracy of the standard mode with the high
finishing degree of the proportional mode (soft).
The proportional mode (soft) is active with G98 (only linear interpolation optimized for short
segments). However, there may be cases where the smoothness of the movement is useful even
outside G98.
Therefore three options have been added to G113:
- G113P Enables proportional mode (soft)
- G113F Returns to movement with feed-forward (rigid) - N.B. obsolete function, use
G113X instead.
- G113X enables the X MODE.
G113P is particularly useful in the case of a sequence of movements in G10 (rough positioning):
the velocity profile is very smooth. This eliminates the mechanical shock that G10 used to produce
in machines featuring high dynamic performances.
If employed on mechanically stiff machines, the results of the G113X are superior to those of
G113P and G113F: a better surface finish is obtained at with higher speeds.
For less stiff machines (those of lager size) and sculptured surface effects, it is possible that the
best results are ensured by the G113P, because the higher accuracy of motions required by G113X
implies higher accelerations which may give rise to mechanical oscillation as a result leading to
undesired marks on the workpiece. The effectiveness and applicability of this function must be
assessed by the manufacturer case-by-case.
To enable the X MODE it is necessary to program G113X, which is modal and disables G113P
and G113F.
The programming of G113X requires that the G114 is active, otherwise the alarm CN2C14
INCOMPATIBLE PARAMETERS will be launched.
For the sake of simplicity in programming, G113X automatically enables G113H (2 millisec) and
G113V (advanced speed management).
With G113X active, it is superfluous to program G113L (8 mS) and G113S (standard speed
management): they will be ignored.
With G113X active G113C is not effective, as it only operates with G113P soft motions.
G113X is interrupted during the G63 synchronized tapping motions and the G61, G62 measuring
motions.
In order that the G113X can reach its best performance levels it is necessary to enter various
calibration parameters into the NC system. This function is carried out easily through G125.
After replacing or changing the calibration values of drives or NC boards, the G125 must be run
before applying G113X.
G113X influences all motions (included the G0 rapid traverse), which are carried out with
minimum tracking error even in steep acceleration and slow-down ramps. Compared to G113F
(which ensures minimum tracking error) the accuracy error is reduced by a factor of 10 at least;
from some tenths to few hundredths of millimeters.
The interpolation mode active after a reset is defined in the machine setup. For further details,
please consult the documentation of the machine tool builder.
These functions are part of the high speed machining system; for further details please see the
relevant M146 "High Speed" manual.
G113X, G113X KA1, G113X KA2 and lathe systems
D. ELECTRON 65
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The G113X, G113X KA1 and G113X KA2 functions have been designed for running part-
programs described with many points in very close succession, typical of milling machines. These
functions are therefore not suitable for lathe system. For further information, please refer to
D.Electron.
66
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
Restoring the original curve from the series of segments is possible provided G114 and G113A
or G113B (Rounding) are active at the same time.
G113A: rounds every programmed segment according to the previous and to the following ones
with the purpose of maintaining the path as continuous as possible.
G113B: executes the same task of G113A, but with better results, mainly when the CAM
generates non uniform segments length, also on smooth surfaces with almost constant curvature.
The HY and HR parameters programmed on the same line as the G114 affect the behavior of
G113A or G113B determining their tolerance and limits of usage.
G113Z: Cancels G113A or G113B (enabled at reset)
These functions are part of the high speed machining system; for further details please see the
relevant M146 "High Speed" manual.
G113A / G113B in lathes
The functions G113A and G113B have been designed to execute part-programs composed by a
large number of very short segments, typical of milling machines. These functions are not suitable
to be used on lathes. For further information, please ask D.Electron.
D. ELECTRON 67
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
To execute a profile made of many small linear segments, a certain quantity of blocks must be
explored ahead and their execution feed must be calculated.
G114: activates the calculation of feed and the exploration of many blocks ahead on the profile.
Cancels G115 and is cancelled by the same.
Some parameters can be programmed (I, RA, HY, HR, J, K) together with G114. They will
define its function:
I: minimum velocity on corners, in mm or inches per minute
RA: corner rounding tolerance (mm or inches)
HY: maximum length of the segment to be rounded (used only if G113A or G113B are
programmed)
HR: maximum chordal error for the reconstruction of the original curvature (used only if
G113A or G113B are programmed, expressed in mm or inches).
J: jerk softness factor. Integer value from 0 to 6.
K: maximum trajectory acceleration, always expressed in mm per square second
Upon start-up, at the beginning of the program, or by programming G114KA0, these parameters
assume the values defined in the machine setting.
This function is part of the High Speed machining system. Please refer to the relevant manual
High Speed M146.
A) Operating lines
These are lines doing something, like axes movement, auxiliary functions, etc.
68
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 69
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
As with permanent formulas, previsional end of travel are not active when G116 is operating, but
real time stops are.
G116 affects all the programmed movements, whether traverse or working, linear or circular.
WARNING
In order to avoid deviations, the first motion after having programmed the
G116 - which effects a translation of the reference system - must contain
the axes measures in logic numbers 0, 1, 2 (normally X, Y, Z).
G116 is incompatible with G43/G44/G45, otherwise it sends a CN5B14 alarm.
G25 (selection of the machining triad) does not affect G116 that operates according to the logic
number of the axes. To make G116 work correctly, the X axis must have logic number 0, Y logic
number 1 and Z logic number 2. To be precise, if X, Y or Z do not correspond to the axes having
logic numbers 0, 1 or 2, we must replace in all the examples given:
- X with the name of the axis with logic number 0
- Y with the name of the axis with logic number 1
- Z with the name of the axis with logic number 2
The following example shows a part program (containing only 90-degree rotations for greater
clarity) together with the positions referred to the straight coordinate system (Xr Yr Zr) and
displayed on screen (Xv Yv Zv), that have been reached at the end of the movement.
Part-Program Line Xr - Xv Yr - Yv Zr - Zv
N1 X0 Y0 Z0 0 0 0 0 0 0
N3 X3 Y2 Z1 13 3 22 2 31 1
N4 G116 X0 Y0 Z0 13 3 22 2 31 1
N5 X0 Y0 Z0 10 0 20 0 30 0
N6 G116 I90 10 0 20 0 30 0
N7 X50 60 50 20 0 30 0
N8 Y20 60 50 20 20 50 0
N9 Z30 60 50 -10 20 50 30
N11 X45 60 45 65 20 50 50
N12 Y50 60 45 65 50 80 50
N13 Z40 50 45 65 50 80 40
70
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
N21 X0 Y0 Z0 0 0 0 0 0 0
Programming only one rotation axis at a time is a necessary limitation to have a clear idea on
the order according to which multiple rotations must be made: as a matter of fact, programming, for
example, a rotation around X and then around Y, or programming this rotation around Y first and
then around X does not lead to the same result.
Rotations around more than one axis can be obtained by cascade programming (on consecutive
lines) the various rotations in the desired order.
2.1.73 G118 HR1 - RTCP for rotary table with combined linear/rotary motions
Modal.
The G118 HR1 special function is used for controlling RTCP (rotation tool centre point) with
combined motions of the rotary and linear axes, for a machine tool equipped with a rotary or bi-
rotary tilting tables (one or two axes, inclined with respect to the main axes triad).
The general format for enabling G118 is:
G118N HR1 [KA] [RA] [X Y Z]
or
D. ELECTRON 71
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
2.1.75 G118S - static RTCP with turning table axis position programming
Modal.
The special G118S function is used for managing the table RTCP (rotation tool centre point).
G118S calculates the corrections to be made to linear axes (XYZ) due to programmed table axis
dimensions.
G118S functionality is equivalent to that of G118 HR2, with the difference that:
- G118 HR2 calculates the translation of the origin depending on the present dimensions of the
table rotating axes.
- G118 S calculates the translation of the origin depending on the rotating axes dimensions
programmed on the same programming line as G118S.
The general format for enabling G118 HR2 in the mono-rotating case is:
G118S table axis dimension [KA] [RA] [X Y Z]
or, in the bi-rotating case, they can be:
G118S dragged axis dimension dragging axis dimension [KA] [RA] [X
Y Z]
G118S dragged axis dimension [KA] [RA] [X Y Z]
72
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
2.1.76 G119 - MDI and jog mode with position transducer alarms
The G119 was introduced to allow axis movement in MDI or in jog mode with transducer alarms
(type CNxx12). The characteristics are as follows:
- G119 has effect only if programmed from a MDI line
- It is modal and transparent at reset
- If G119 is active the type 12 transducer alarms are ignored
- It is automatically reset if an automatic program is launched or if there is an attempt to
launch any subroutine from MDI mode (even if it is a special M)
To move the axes in jog or in MDI mode with type 12 alarms, one must:
- enter MDI mode
- write G119, press Enter and then START
- press RESET (the transducer alarms disappear)
- work normally in MDI or in jog mode.
WARNING:
When G119 is active, the software end of travel are disabled on all the
axes because transducer may contain insignificant distances therefore
preventing the movement from taking place. It is up to the operator to take
care to avoid collisions and damage. In any case, as an extra precaution,
Z32 will automatically activate the TEST condition (reduction of rapid
movement to 1/5) when G119 is active.
D. ELECTRON 73
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
This function is incorporated into the RTCP system (rotation tool centre point) to compensate for
workpiece fixturing errors during the motions of rotary axes on tilting tables.
The general programming format is:
G122 I J K
For a more detailed explanation on the use and on the functioning please refer to the M154
Manual, Rotation (RTCP).
On reset and on program start, the default conditions are the following:
- range limits from +infinite to infinite on all NC-controlled axes
- both the negative and positive limits are disabled (G123KA0)
- this configuration does not causes alarms and limits the number of measures exceeding the
range (G123KA4)
Rules and limitations for G123
G123 must be programmed in a separate line, otherwise the CN2C14 INCOMPATIBLE
PARAMETERS alarm will ensue.
In a line with G123, KA must be programmed with a value chosen exclusively among the
following values: -1, 0, 1, 3, 4, 5.
74
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
If KA is programmed more than once, only the last value programmed is retained.
If the KA value is other than the admissible ones, the CN2C14 INCOMPATIBLE PARAMETERS
alarm will ensue.
If KA1 or KA-1 are programmed, the measures of the axes (all NC-controlled axes) are
considered as positive (if KA1) or negative (if KA-1) limits.
With KA1 and KA-1, if some axis measures are not entered, the corresponding limits will be
retained.
The programming of positive limits and negative limits must be carried out on different lines.
It is possible to enable either positive limits or negative limits, or enable both positive and
negative limits at the same time.
On each axis, (positive limit) > (negative limit), otherwise the CN5514 G123 LIMITS NOT VALID
alarm will ensue.
On reset, all positive and negative limits are disabled and the standard mode is resumed (KA4).
The programmed limits are always referred to the active origin.
With G123 enabled in its standard mode (KA4) the final measures programmed are replaced, if
they exceed the range, with the limit measures.
With the G123 enabled in the KA3 mode, if the final measures programmed exceed the range,
the CN5614 G123 QUOTA EXEEDS LIMITS alarm will ensue.
If a circle is programmed (G2 or G3) with G123 enabled, the CN5714 G123 CIRCLE+G123
alarm will ensue.
With G123 KA1 or G123 KA-1 only the measures of the NC-controlled axes can be displayed as
programmed measures, otherwise the CN2C14 INCOMPATIBLE PARAMETERS alarm will ensue.
If G53 is programmed with G123 enabled, or vice-versa G123 with G53 enabled, the CN5A14
G123+G53 alarm will ensue.
If G105 is programmed with G123 enabled, the CN5914 G123+G105 alarm will ensue.
WARNING
If more than 5 axes move during the stopping procedure, on resuming the
motions more than 5 axes will be considered as programmed, and
therefore the CN2C14 INCOMPATIBLE PARAMETERS alarm will ensue.
The lines related to the stopped motions are not displayed, unless they contain auxiliary
functions.
Disabling procedure
By programming G123KA0 it is possible to eliminate both the positive and the negative limits,
however all the programmed settings (limits, KA3 or KA4) remain enabled.
In order to restore a previous positive limit it is sufficient to program G123KA1 without entering
any measure, while a negative limit can be restored by programming G123KA-1 without entering
any measure.
Programming the G123 limits with a measure already out of range
D. ELECTRON 75
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
Let us now consider the case (for the sake of simplicity, we will refer to a single axis) of range
limits programmed with G123, while the current measure already exceeds these limits: for example,
when we have X=80 and enter G123KA1X30.
Here, a distinction must be made between G123KA3 (alarm mode) and G123KA4 (limitation
mode).
G123KA3, case 1:
G0X100
G123KA3
G123KA1X30 the only positive limit is on X
G0X40 CN5614 G123 QUOTA EXCEEDS LIMITS alarm
G123KA3, case 2:
G0X100
G123KA3
G123KA1X30 the only positive limit is on X
G0X10 X goes to 10 (within the set limits)
G123KA3, case 3:
G0X100
G123KA3
G123KA1X30 the only positive limit is on X
G0Z200 Z goes to 200
G0Y300 Y goes to 300
G0X50 CN5614 G123 QUOTA EXCEEDS LIMITS alarm
G123KA4, case 1:
G0X100
G123KA4
G123KA1X30 the only positive limit is on X
G0X40 X goes to 30 even if 40 has been set
G123KA4, case 2:
G0X100
G123KA4
G123KA1X30 the only positive limit is on X
G0X10 X goes to 10, within the G123 limits
G123KA4, case 3:
G0X100
G123KA4
G123KA1X30 the only positive limit is on X
76
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
EXAMPLE 2%
G0X20Y20Z20
G123KA1X30Y40Z50 positive limits
G123KA-1X-10Y-15Z-20 negative limits
G0X-60Y-60Z-60 end point X=-10, Y=-15, Z=-20
G0X60 X stops at 30
G0Y80 Y stops at 40
M2
EXAMPLE 3%
G0 X0 Y0 Z0
G123 KA1 Y20 only positive limit: max Y =+20
G123 KA5 enables stop mode
G1 F1000 X5 motion executed
X-10 Y25 Z-20 motion not executed as Y exceeds range
X-12 Z30 motion not executed as Y still exceeds range
Y10 motion executed as if X-12 Y10 Z30 had been programmed
D. ELECTRON 77
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G124 [KA1] enables the handwheels of the rotary axes linked to G117; KA1 is not necessary
G124 KA0 disables G124
Rules and limitations for G124:
When turning on the system and on reset G124 is disabled.
The G124 programming is effective only if G117 is active.
If G124 is programmed with G117 disabled, the effect will be nil, even though no alarm is
released.
The activation commands: G124 or G124KA1 are equivalent.
If G117 is disabled while G124 is running, G124 will be disabled too.
If one of the rotary axes linked to G117 is programmed while G124 is running, the CN5814
G124+G117 ROTATIVE AXIS alarm will ensue.
As a consequence, the only way to move the rotary axes linked to G117 while G124 is running is
to use the handwheels.
Disabling procedure
By programming G124KA0 the handwheels of the rotary axes linked to G117 are disabled and
the axes can be re-programmed.
Programming examples
Let us suppose to have a machine with bi-rotary head and XYZABC axes, where A and B are
the two rotary axes linked to G117, while C is another rotary axis not linked to G117.
Example 1:
G0X0Y0Z0A0B0C0
G117
G0A20B30X40
G124 from now on, A and B can only be moved using the handwheels
G0X10Y10Z10C40 ok (C axis not linked to G117)
G0A10 alarm CN5814 because the A axis has been programmed
Example 2:
G0X0Y0Z0A0B0C0
G117
G0A30B40X40
G124 from now on, A and B can only be moved using the handwheels
G0X10Y15Z25C30 ok (C axis not linked to G117)
G0Z0X0Y0C0 ok
G124KA0 A and B handwheels disabled: A and B can be re-programmed
G0A15B35X10 ok
Example 3:
G0X0Y0Z0A0B0C0
G124 no effect as G117 is not active
G117
78
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
2.1.82 G125 - G125 KA1 - G125 KA101 - axis calibration for high-speed tasks
To get the best performance from axis control via "X MODE", which is activated by G113X or
G113X KA1 or G113X KA2, it is advisable to perform more than one setup G125 (at least two) for
each axis concerned.
G125, G125 KA1 or G125 KA101 - which must be executed in semiautomatic mode, or in
automatic mode by the part-program - allows these otherwise difficult calibrations to be carried out
simply, rapidly and accurately.
These functions are incorporated in the high-speed machining system. Further details are
available in the M146 Manual, High Speed.
The description of the system (for the users of machines which are configured for process lock
functions) is available in the M252 Manual, Process lock.
D. ELECTRON 79
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
However, a passive motion does not provoke a relative motion between the workpiece and the
tool tip: in fact, it keeps the tool tip still with respect to the workpiece.
- with RTCP and G131 active, the programmed feed will only be referred to linear axes
- the execution time of the linear axes motions is calculated on the basis of the programmed
feed and the translation length of linear axes
- at this point, a new feed value is calculated that is expressed as the inverse of the time
calculated as above, and the result will be like that of a G93 programmed with this feed value.
- in the G131 enabling line, it is possible to enter the I parameter followed by a positive number
that indicates the maximum speed of the rotary axes involved in the programmed motion; if this
parameter is not entered, the maximum speed will be the rapid traverse speed.
WARNING:
- if the feed value calculated as above is too high for some of the axes involved in the motion,
the feed will be limited properly
- if the translation length of linear axes tends to zero, the rotary axes will have a higher speed
that will be eventually taken to the maximum admissible speed as specified by the I parameter; if
this parameter is not entered in the G131 line, the maximum speed will be the rapid traverse speed
- in blocks where the translation length of linear axes is zero, the rotary axes will revolve at their
maximum admissible speed (I parameter or rapid traverse)
- in blocks without linear axes, the rotary axes will revolve at their maximum admissible speed (I
parameter or rapid traverse)
- if the programmed motion contains passive motions along the XYZ axes that are induced by
the RTCP rotary axes, and the resulting speeds of XYZ axes are too high, these speeds will be
properly limited to those allowed for XYZ; this however provokes speed variations between tool tip
and workpiece
- in particularly long translation motions, speed variations may arise due to the passive motions
on the linear axes induced by RTCP rotary axes
- If G131 is enabled, G93 or G94 or G95 will be eliminated; vice-versa, if G131 is active, the
enabling of G93 or G94 or G95 will eliminate G131.
80
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
not the same on blocks with longer movements: the reason is: by programming linear axes with
G132 KA2 and G132 KA3 a cylinder rotation (G132 KA2) or table (G132 KA3) radius variation may
happen inside the same block.
D. ELECTRON 81
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
82
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
different tool radius that that used for the part-program computation: in this case there is the
necessity for the CNC to correct the movements, taking into account the radius difference.
G132KA2 addresses this problem.
The physical structure is determined by a machining on the exterior side of a cylinder, rotating
around a machine axis (for example X axis) through a part-program having:
programmed linear movements along an axis parallel to the cylinder rotation axis (ex. X axis)
and along an axis perpendicular to that (ex. Y axis)
programmed movements for the cylinder rotation axis (example A axis)
The complete syntax of G132KA2 is the following (supposing the part-program contains
movements for axis1 axis2 axis4):
G132 KA2 (axis1)(v1) (axis2)(v2) (axis3)3 (axis4)(v4) HX(vaxis2)
HY(vaxis3) HR(vr) I(vf)
where:
(axis1) is the name of the linear axis parallel to the cylinder rotation axis
(v1) may assume only the values +1 or -1, to indicate if the computed correction must be applied
to axis1 with its sign or with opposite sign
(axis2) is the name of the other linear axis
(v2) may assume only the values +2 or -2, to indicate if the computed correction must be applied
to axis2 with its sign or with opposite sign
(axis3) is the name of the axis specifying, together with axis2, a plane orthogonal to the cylinder
rotation axis (if axis1=X, axis2=Y, then axis3=Z) and never programmed
3 is a mandatory numeric value, allowing the CNC to identify the axis
(axis4) is the name of the rotating axis (whose rotation axis is parallel to axis1)
(v4) may assume only two values +4 or -4: +4 indicates that a positive rotation of axis4
corresponds to a positive displacement of axis2, while -4 indicates that a positive rotation of axis4,
corresponds to a negative displacement of axis2.
(vaxis2) numeric value, in milllimeters, indicating the position from the cylinder rotation axis,
along the axis2 coordinate, relative to the active origin
(vaxis3) numeric value, in milllimeters, indicating the position from the cylinder rotation axis,
along the axis3 coordinate, relative to the active origin
(vr) numeric value, in millimeters, representing the difference between the radius used by the
CAM for path computation, and the radius of tools mounted on the spindle. Maximum allowed value
is 8,192 mm.
(vf) is the maximum feed, in mm/min, used by the CNC to move all linear axes for correction
purposes
Example:
G132 KA2 X1 Z-2 Y3 B4 HX10 HY5 HR-0.5 I1800
Introduces a correction for cylindrical cams, where:
- linear axes are X (first linear axis), Z (second linear axis) and Y (third linear axis)
- the cylinder rotation axis is parallel to X axis
- the plane orthogonal to the cylinder rotation axis is the YZ plane
- the rotating axis with rotation axis parallel to the first linear axis (X in this case) is B
- a positive rotation of B corresponds to a positive displacement of Z
- the correction along Z axis ha a sign opposite to the computed theoretical value
D. ELECTRON 83
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The cylinder rotation center has coordinates (10.5) in the reference system with origin on active
origins of the two axes (Z,Y)
- the used tool radius is 0.5 mm smaller than that used by the CAM
- maximum correction speed is 1800 mm/min
The correction may be deactivated by programming:
G132 KA0
Some notes on the programming syntax for G132 KA2
- lengths and feed values are expressed in mm and mm/min, also on inches programmed
machines
- parameters axis1, axis2, axis3, axis4, HX, HY, HR and corresponding values are mandatory
- the I parameter is optional, and if not programmed, a default value of 500 mm/min is assumed;
maximum allowed value is 2000 mm/min
- all line elements may be programmed in any order
- numeric values may be programmed also through expressions (for example HR<R-10>)
- G132 KA2 is not compatible with G53/G54
- G132 KA2 is compatible with RTCP
- with G132 KA2 active, both linear and rotating axes movements may be programmed: the
correction movement along the two linear axes axis1 and axis2 is added to that programmed for
these axes
Other information on the real time movements execution modes:
- on activation of G132 KA2, all corrections start from zero and reach those computed with a
connection starting after a delay (at least 0.03125 rotating axis degrees, or 0.1 mm linear axis
displacement are needed) and lasting for the time necessary to reach the final correction value;
therefore the space immediately following the G132 KA2 activation must be executed in order to
avoid profile errors.
- on deactivation (after G132 KA0), a reverted correction recovery movements is made: also in
this case it is necessary to execute it without contact with the workpiece in order to avoid errors
- during block search the correction is not active. When the machining is resumed, the initial
connection element is executed, in the same way as on G132 KA2 activation.
- during the machining the maximum correction feed (for each linear axis) is limited to the
programmed value (default 500 mm/min) If the geometry requires higher values, correction errors
arise, possibly recovered later on, when the feed returns inside allowed limits
- the corrections are computed depending on the axes movement directions, and amplified by
the radius difference programmed with HR. The finishing degree depends on the programming
regularity, but also on the radius difference, which must be maintained as smallest as possible
(much lower than the HR allowed limit of 8,192 mm).
84
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
where:
(axis1) is the name of the linear axis programmed, one of the two axes of table plane
(v1) may assume only the values +1 or -1, to indicate if the computed correction must be applied
to axis1 with its sign or with opposite sign
(axis2) is the name of the other linear axis of table plane, never programmed in part-program
movements, and always equal to the position, along axis2, of the table rotation center
(v2) may assume only the values +2 or -2, to indicate if the computed correction must be applied
to axis2 with its sign or with opposite sign
(axis3) is the name of the rotating axis (whose rotation axis is orthogonal to the table plane
defined by axis1 and axis2)
(v3) may assume only two values +3 or -3: +3 indicates that a positive rotation of axis3
corresponds to a positive displacement of axis2, while -3 indicates that a positive rotation of axis3,
corresponds to a negative displacement of axis2.
(vaxis1) numeric value, in milllimeters, indicating the position of the table rotation center, along
the axis1 coordinate, relative to the active origin
(vr) numeric value, in millimeters, representing the difference between the radius used by the
CAM for path computation, and the radius of tools mounted on the spindle. Maximum allowed value
is 8,192 mm.
(vf) is the maximum feed, in mm/min, used by the CNC to move all linear axes for correction
purposes
Example:
G132 KA3 Y1 X-2 C-3 HX10 HR-0.5 I1800
Introduces a correction for polar cams, where:
- linear axes are Y (first linear axis) and X (second linear axis)
- the plane orthogonal to the table rotation axis is the XY plane
- the rotating axis with rotation axis orthogonal to the table plane is C axis
- a positive rotation of C corresponds to a negative displacement of X
- the correction along X axis ha a sign opposite to the computed theoretical value
- the table rotation center has coordinates 10 in the reference system with origin on active origin
of Y axis
- the used tool radius is 0.5 mm smaller than that used by the CAM
- maximum correction speed is 1800 mm/min
The correction may be deactivated by programming:
G132 KA0
Some notes on the programming syntax for G132 KA3:
- lengths and feed values are expressed in mm and mm/min, also on inches programmed
machines
- parameters axis1, axis2, axis3, HX, HR and corresponding values are mandatory
D. ELECTRON 85
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
- the I parameter is optional, and if not programmed, a default value of 500 mm/min is assumed;
maximum allowed value is 2000 mm/min
- all line elements may be programmed in any order
- numeric values may be programmed also through expressions (for example HR<R-10>)
- G132 KA3 is not compatible with G53/G54
- G132 KA3 is compatible with RTCP
- with G132 active, both linear and rotating axes movements may be programmed: the
correction movement along the two linear axes axis1 and axis2 is added to that programmed for
these axes
Other information on the real time movements execution modes:
- on activation of G132 KA3, all corrections start from zero and reach those computed with a
connection starting after a delay (at least 0.03125 rotating axis degrees, or 0.1 mm linear axis
displacement are needed) and lasting for the time necessary to reach the final correction value;
therefore the space immediately following the G132 KA3 activation must be executed in order to
avoid profile errors.
- on deactivation (after G132 KA0), a reverted correction recovery movements is made: also in
this case it is necessary to execute it without contact with the workpiece in order to avoid errors
- during block search the correction is not active. When the machining is resumed, the initial
connection element is executed, in the same way as on G132 KA3 activation.
- during the machining the maximum correction feed (for each linear axis) is limited to the
programmed value (default 500 mm/min) If the geometry requires higher values, correction errors
arise, possibly recovered later on, when the feed returns inside allowed limits
- the corrections are computed depending on the axes movement directions, and amplified by
the radius difference programmed with HR. The finishing degree depends on the programming
regularity, but also on the radius difference, which must be maintained as smallest as possible
(much lower than the HR allowed limit of 8,192 mm).
86
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 87
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G134 KA0
In milling machine forced operation, the diameter programming (G107) is suspended. If G107 is
programmed while in milling machine mode, the alarm CN1D4 PROGRAMMING ERROR is
triggered.
The forced lathe mode can be deactivated via the G134KA1 (after reactivating the XZ working
surface), G134KA2 or G134 KA3 functions.
Let us assume a lathe machine configuration, capable to act also as a milling machine with X, Z,
Y, Q, C, M axes, where:
M, C = spindle/turning table
X, Z = lathe axes (radial, longitudinal)
Q = tool axis (milling machine), motorized
Y = Y axis (milling machine)
The milling machine mode is activated with the following sequenze:
G43Q (activates the L correction on Q axis, may be omitted if Q axis has the logical number 2)
G25ZYQ (activates the milling machine tern)
G134KA0 (activates milling machine mode)
(milling programming)
G134KA2 (restores lathe mode)
Operation of G134 KA1
This functionality is reserved to machines where the mill axes X and Z are also used as lathe
axes.
The machining plane XZ valid for lathes must be activated (for example with G25XZY) before
the activation of lathe functionality, otherwise the alarm 2C14 NOT COMPATIBLE PARAMETERS
is issued.
Operation of G134 KA2
This feature allows to activate the lathe functionality also if the XZ mill axes are not used as XZ
lathe axes.
General programming syntax:
G16 G134 KA2
A G16 programmed in the same line as G134 KA2 allows to define the name of the axes
designed to behave as XZ in a lathe. The two functions must be separated by one or more blanks,
otherwise the alarm CN1D14 PROGRAM ERROR is issued.
For example, suppose a mill having XYZ as main axes (logical numbers 0, 1, 2) desired to
operate as a lathe where:
- mill Y axis becomes the diameter axis of lathe (X axis of lathe)
- mill X axis becomes the longitudinal axis of lathe (Z axis of lathe)
- mill Z axis becomes a third axis of lathe (Y axis of lathe)
The following must be programmed:
G16ZXY G134 KA2
After executing this line, a lathe machine with XZ conventional axes is available, but
corresponding to Y and X axes of the milling machine; in this case it is therefore implicit also the
definition of the new ZX machining plane, like if, after G134 KA2, a G25ZX were programmed.
88
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
If other G16 or G25 were active before G113 KA2, they are frozen and automatically restored
when the G134 KA2 is canceled from G134 KA0, restoring the milling machine.
If G16 is not programmed with G134 KA2, it is like programming a G16 confirming the main
machine axes (or G16XYZ). Previously active G16 and G25 are frozen and restored with G134
KA0, also if G16 is not programmed.
Under JOG (activity 4) the physical axes defined in machine setup must be moved, also if G134
KA2 is active; in this case the axes redirection obtained with the G16 of G134 KA2 is not active.
Operation of G134 KA3
The G134 KA3 function allows enabling the lathe mode specifying on the programming line
which of the X and Z axes will be used as diametral axis and which as longitudinal axis.
Syntax (identical for machines in mm and inches):
G134 KA3 X0 Z1 (activates Z as diametral axis and X as longitudinal axis)
G134 KA3 X1 Z0 (activates X as diametral axis and Z as longitudinal axis)
Characteristics:
With stop (like G134 KA0, KA1, KA2).
It gives the CN2C14 INCOMPATIBLE PARAMETERS alarm if:
- X and Z are not programmed with one of the two combinations shown
- Either G53 or permanent formulas or G116, G117, G118 and G16 are active
- Parameters or axes are programmed in the line
- Axis names other than X,Y,Z are assigned to logical numbers 0,1,2 during setup.
After activation:
- If X1Z0 was programmed , X becomes the lathe diametral axis, Z the longitudinal one
- If X0Z1 was programmed , Z becomes the lathe diametral axis, X the longitudinal one
- The LX and LZ tool lengths are applied respectively to X and Z axes, not to the radial and
longitudinal ones, as with other G134
- The names of the displayed axes always correspond to physical axes and not conventional
lathe ones, that would be X = diametral axis; Z = longitudinal axis
- With G134 KA0, the G134 KA3 effect is ended (it returns a mill)
- G53 programming ends the lathe operation
- Any active G113X will be disabled and G113F forced
- It is deactivated with G53 or G134 KA0
On deactivation:
- Any m/min G96 or mm/turn G95 activations are eliminated
- Any programming and/or diametral display is eliminated
- Any G113X (forced to G113F by lathe mode) is not restored, so it is up to the programmer
to possibly reprogram G113X.
D. ELECTRON 89
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G135 I1 function
During the execution of a trajectory, the G135 I1 function allows changing the management of
slowdowns due to curvature changes (increasing or decreasing the curvature jerk applied to the
points where a curvature change occurs, such as the line-circle or circle-circle transitions).
If G135 I1 is used to obtain an increase in the curvature jerk, fewer machine slowdowns will be
observed at the points where the trajectory curvature changes, and the execution time will be
shorter.
If G135 I1 is used to obtain a reduction in the curvature jerk, more machine slowdowns will be
observed at the points where the trajectory curvature changes, and the execution time will be
longer.
The programming syntax is:
G135 I [HX]
G135 I0 Cancels G135 I1 advanced management
Programming to obtain an increase in the execution speed:
G135 I1 Activates G135 I1 management, no increase in the curvature jerk
G135 I1 HX0 No increase in the curvature jerk
G135 I1 HX1 2 times increase in the curvature jerk
G135 I1 HX2 4 times increase in the curvature jerk
G135 I1 HX3 8 times increase in the curvature jerk
G135 I1 HX4 16 times increase in the curvature jerk
Programming to obtain a reduction in the execution speed:
G135 I1 HX-1 2 times reduction in the curvature jerk
G135 I1 HX-2 4 times reduction in the curvature jerk
G135 I1 HX-3 8 times reduction in the curvature jerk
G135 I1 HX-4 16 times reduction in the curvature jerk
Notes:
- The HX parameter can only be programmed as an integer number from -4 to +4.
- Take into account that the overall effect of negative HX on G135 and J on G114 is limited to
+6. So, if J on G114 = 5, the values of HX on G135I1 lower than -1 will not be effective.
G135 J1 function
The G135 J1 function separates the management of rotating axes used in RTCP from the
management of all other machine axes. With G135 J1 it is possible to define a rounding tolerance
to be applied only to the rotating axes in RTCP, different from the tolerance applied on all other
machine axes (specified through the RA parameter of the G114 function).
Syntax:
G135 J [HY]
G135 I0 cancels the advanced management G135 I1
G135 J1 HY0.1 activates the G135 J1 advanced management with a tolerance for
rotating axes of 0.1 mm
Note: the HY parameter is the tolerance in degrees applied to the rotating axes in RTCP.
90
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 91
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The distance of the tool from the work piece is affected by the position of both V (position of the
piece in the example) and Y (position of the spindle in the example).
The V movement effect on Y could be compensated by varying Y origin, but for convenience of
use G139 can instead be used.
Y axis compensation is obtained by programming:
G139
G139 reads the V position with respect to its additional origin (inclusive of any L length) and
automatically compensates the Y origin as a function of this value. That is, it uses the V dimension
to vary the Y origin.
The origin variation carried out on the Y axis by G139 is automatically performed inside the
control and does not involve visible changes in the origin table.
Through RST(8991), it is possible to read the corrections currently set by G139 in the origins of
the three linear axes. The value is in mm. In the example, as the Y axis is compensated, the value
shown by the currently set correction is RST(90).
G139 characteristics:
- It is a function with stop. It also causes the immediate compensation recalculation with the
current positions
- The axes defined during setup as "concurrent" must be continuous (logical num. 012) and
existing, otherwise G139 causes the CN2C14 INCOMPATIBLE PARAMETERS alarm
- G139 "photographs" the V position with respect to the base origin and activates Y
compensation as against the V position, namely changes the Y dimension as a function of the V
position.
- Together with G139, only N (line number) # and #A can be programmed, but no axis or system
parameter (HX, HY, HR, HT, I, J, K, etc...), or other G, otherwise the CN2C14 INCOMPATIBLE
PARAMETERS alarm is given.
- To calculate the compensation sign, it is assumed that a V movement in the positive direction
has the same effect as Y in the positive direction (moves the tool away from the work piece)
- G53 suspends the compensation due to G139, G54 resumes it
- Programming G139 with active G53 is admitted as a predisposition. G139 will remain
suspended until the next G54
- If, with an active G139, V moves, Y compensation does not change but remains that frozen by
G139; to calculate the new compensation, it is necessary to re-program G139.
- During the block search, the V position read by G139 is not the physical but the programmed
one. This way it is ensured that, at the end of the block search, the compensations active on Y are
the same that occur during the actual implementation. However, if the physical position differs from
the programmed one by less than the positioning error defined in the settings, the physical location
is employed so as to avoid differences due to small errors in the V axis positioning or locking.
- If table V moves a turntable on which G118 is applied, the G118 centre table dimensions
(which do not take into account G139):
- They must necessarily be taken with G120 when V=0 (otherwise position errors are
generated)
- Can be written by PLC with FFWRCENTAV
- Can be written by part-program with SET[27],[28],[29]
- The PLC ZZCENTAV (for a spindle 0 and 1) and ZZCENTAV2 (spindle 2) parameters do not
take into account G139, that is express the centre table dimensions when V=0.
- G139 is transparent at RESET (its effect persists after a RESET), but is lost at power off.
92
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
Activation:
G141 axis1 axis2 axis3 I... J... K... KA...
where:
axis1, axis2, axis3=names of continuous axes defining the tern chosen for G141
corrections. In detail axis1=first axis of the tern, axis2=second axis of the tern, axis3=third axis
of the tern, it is therefore important the programming order to identify the specified tern. The axes
tern must follow G141 in the activation line.
I=difference between theoretical radius and actual radius of the tool
J=difference from theoretical radius and actual insert radius, in case of toroidal mill
K=zeroing distance from tool tip:
K=0 for tip zeroed tool
K=I for center zeroed tool, in case of spherical mill
K=J for center zeroed tool, in case of toroidal mill
KA=milling tool type:
KA0 or not programmed for spherical mill
KA1 for toroidal mill
A cylindrical mill is a special case of toroidal mill, having the parameter J=0
If the tern is not programmed in the G141 activation line, the G141 tern is assumed to be the
machining tern actually active.
axis3 must be the axis parallel to the tool (this axis may be changed through G43 or G44,
before programming G141).
Corrections computed by G141 have a sign depending if the tool length is positive (G43) or
negative (G44), therefore added or subtracted from the programmed positions.
After G141 activation, all movements concerning at least one position of the tern chosen for
G141, must contain all three components of the vector orthogonal to the machining surface, also if
not changed from the preceding block.
In blocks subsequent to the G141 activation, positions not related to the G141 tern may also be
programmed.
In program lines following the G141 activation, blocks not containing any axes of the tern and no
component of the orthogonal vector are allowed.
Let us consider the following situation:
Z,Y,X = tern axes
A,B,C = other axes external to the tern
I,J,K = components of orthogonal vector
G141 Z Y X I1 ;correction for spherical milling tool, tip zeroed, ZYX tern with tool aligned
along X
....
D. ELECTRON 93
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
Deactivation
G141 is deactivated by programming G140, function without any parameter
G141 I2 ;activation
....
G140 ;deactivation
94
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
This important feature allows to avoid damages to the workpiece in particular situations, for
example following a sudden power loss. This function requires dedicated PLC management and
special requirements on the electric drive control for the axes: please refer to the machine tool
builder for further details.
Generalities
This feature has the following effect: during normal machining, a signal defined by the logic is
activated and the machining is immediately stopped (all machine axes); the stop procedure is the
same followed when the STOP pushbutton is pressed, then a movement of programmed entity is
executed along the tool axis or along one of the axes with logical number 0(X), 1(Y), 2(Z). When
this movement has been executed, the CNC issues the alarm CN7E14 G142 EXECUTED; this
alarm may be cleared with a RESET or shutting down and restarting the machine.
This feature is useful for example to lift the tool from the machining surface in case of a sudden
power loss.
Note: in the following discussion X, Y, Z will refer respectively to the axes with logical number 0,
1 and 2.
This feature is activated through the function G142,
Activation
The programming syntax is as follows:
G142 [K/X/Y/Z] [F]
where:
K followed by the displacement value with its sign, in mm or inches, if a movement along the tool
axis is desired. When G142 is active, the tool must be always associated to one of X, Y, Z axes
(G43/G44), but its direction may be rotated as a function of the associated spindle head: the K
choice defines a movement along the tool axis direction, rotated by the rotating head axes, thus
having a direction in the space capable to command motion on all three X, Y and Z axes.
X followed by the displacement value with its sign, in mm or inches, if a movement along the
axis with logical number 0 is desired.
Y followed by the displacement value with its sign, in mm or inches, if a movement along the
axis with logical number 1 is desired.
Z followed by the displacement value with its sign, in mm or inches, if a movement along the
axis with logical number 2 is desired.
K, X, Y and Z are mutually exclusive, only one among KXYZ may be programmed.
F feed in mm/min. or inches/min. used to execute the displacement.
Deactivation
The function G143 deactivates G142. This G function is without parameters.
Notes
- If G142 is programmed first in a part-program without any parameter, the values specified in
machine setup for retraction entity and execution feed are assumed. Please refer to the information
supplied by the machine tool builder.
- If G142 is programmed a second time without any parameter, after a G143, the function will be
reactivated with the preceding activation parameters.
D. ELECTRON 95
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
96
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
It may be useful on some machines to execute the retract movement also if MU alarms or
CNxx12 alarms are present, if the encoders of the axes interested in the retract are not in alarm.
The special retract management executes automatically (without any intervention of the PLC
logic) the retract movement when the system is in one of the above cited alarm conditions (CNxx12
or MU).
If the special retract management is active, and if the G142 is programmed, if an MU alarm or
an encoder alarm (type 12) is issued on axes not interested in the retract movement, the CNC
executes the retract movement as specified by the G142.
N.B. If the retract movement is defined along one axis (G142X, or G142Y, or G142Z) the retract
movement is executed if the specified axis is not in alarm. If the retract movement is instead
defined along the tool axis (G142K) the retract movement is executed only if all the three axes with
numlog 0, 1, 2 are not in alarm.
D. ELECTRON 97
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
It is only permitted in a part program; if programmed in MDI, it generates the CN1D14 ERROR
PROGRAM alarm.
It is a function with stop.
At least one continuous axis must be programmed, but all axes that need to be moved to jog
can be programmed.
Any feed programmed in the line has no effect on G144 but remains active for successive part-
program lines.
No other parameters are permitted in the line.
The movement in JOG is performed in G113P; any active G113F or G113X before G144 is
temporarily disabled and reset at part-program restart. As in G113P the tracking error is
proportional to speed, if the set speed is excessive and the machine settings do not support it,
CN0013 alarms interrupting JOG may be generated.
The JOG speed is the default one but can be changed by the operator by setting the feed from
the keyboard.
As after G144 KA1 an active JOG is active to all effects, movements can be controlled via fixed
buttons in micrometric or work or rapid mode, depending on the selector as well as any handwheels
and switched axes selected in the line.
After the movement in JOG, by pressing START, the part program restarts from the end point
without requiring repositioning. After G144, it is up to the programmer to define axis movements
compatible with any motion performed during G144.
G144 suspends the OFFSETJOG feature and restores it at restart by pressing the start
pushbutton (i.e. G144 appropriates all dedicated JOG pushbuttons even if the OFFSETJOG
feature is active).
98
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
G147
The G147 allows to define the radius of the rotating feed master axes in order to transform the
movement of the rotating axis in an equivalent linear movement capable to be used to compute the
feed on the path, when this axis will be used as feed master axis (the transformation is done by
multiplying the displacement expressed in radians for the radius associated to the axis).
Activation syntax:
G147 Axis1 Radius1, [Axis2 Radius2], .....[AxisN RadiusN]
where:
Axisi = axis name
Radiusi = dimension of the radius associated to the axis, expressed in mm (or in inches for
machines in inches)
The programming of G147 must respect the following rules:
- all axes programmed with G147 must be rotating axes, otherwise the alarm CN2C14 - NOT
COMPATIBLE PARAMETERS is issued.
- each programmed axis must be followed by the value of the radius, otherwise the alarm
CN1D14 - PROGRAM ERROR is issued.
Deactivation syntax:
G147 KA0
This instruction deactivates the radiuses of rotating axes and restores the default situation (1
degree = 1 mm).
The default value for the radius of G147 rotating axes set after a reset is 57.29578 mm, thus
obtaining the equivalence 1 degree = 1 mm. That means that if a rotating axis is programmed as
feed master axis, without any radius association, this axis will have the default value specified
above.
Example:
suppose a machine having X, Y, Z, A, B, C axes, where X, Y and Z are linear axes and A, B
and C are rotating axes. By programming the following line:
D. ELECTRON 99
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
the axis A will have an associated R radius of 50 mm, the axis C an R radius of 100 mm. This
means that an equivalent linear movement to a rotating movement of the A axis will be done by:
DLA = DA * R / 57.29578 = DA * 50 / 57.29578 = DA * 0.87266 mm
where:
DA = A displacement in degrees
DC = C displacement in degrees
57.29578 = degrees in a radian
DLA = equivalent linear displacement of A axis in mm
DLC = equivalent linear displacement of C axis in mm
G147 KA1
The G147 KA1, similarly to G147, allows to define the radius of one or more rotating feed
master axes in order to transform the movement of the rotating axis in an equivalent linear
movement capable to be used to compute the feed on the path, when:
similarly to G147:
- G148 active
- the rotating axis is a feed master axis
or when:
- G148 active
- the rotating axis is not a feed master axis and the movement do not comprise any feed
master axis
Activation syntax:
G147 KA1 Axis1 Radius1, [Axis2 Radius2], .....[AxisN RadiusN]
where:
Axisi = axis name
Radiusi = dimension of the radius associated to the axis, expressed in mm (or in inches for
machines in inches)
Deactivation syntax (same as G147):
G147 KA0
programming examples with linear axes X, Y, Z and rotating axis A
case 1:
G148 XA feed master axis XA
G147KA1 A114.59 radius transforming 1 degree in 2 mm
G1F5000X100A100 for the feed computing, the movement of A axis is of 200 mm
and not 100 degrees
case 2:
100
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
G148
The G148 function defines the feed master axes and refers the programmed feed only to these
axes (those specified in the G148 activation lines).
G148 is a function with stop.
Activation syntax:
G148 Axis1, [Axis2], ........[AxisN]
where:
Axisi = name of continuous axis
The programming of G148 must respect the following rules:
- at least one continuous axis must be programmed in the G148 line, otherwise the alarm
CN2C14 - NOT COMPATIBLE PARAMETERS is issued.
- it is possible to program one or more continuous axes on the G148 line without having
previously defined their radius with the G147 function. In this case the default radius of 57.29578
mm (1 degree = 1 mm) is considered.
- G148 may be programmed only if it was not already active, otherwise the alarm CN2C14 -
NOT COMPATIBLE PARAMETERS is issued.
- if a movement containing no feed master axes is programmed when the G148 is active, the
programmed feed will be referred to all the axes interested in the movement.
- if G131 is programmed while G148 is active (or vice versa), the alarm CN8514 - G131+G148 is
issued.
Deactivation syntax:
G148 KA0
This command resets all feed master axes (no axis, after this instruction, still is a feed master
axis) and refers the programmed feed to all the axes interested in the movements.
When G148 is active, the display of the actual feed is referred only to the feed master axes. If no
feed master axis is moved, the actual feed is displayed in classical mode (referred to all moving
axes).
Example:
suppose a machine having X, Y, Z, A, B, C axes, where X, Y and Z are linear axes and A, B
and C are rotating axes. Furthermore Ra=57.29578=radius previously associated to A through the
G147 function, by programming:
G0 X0 Y0 Z0 A0
G148 X A
F5000
G1 X50 A50 Y50
D. ELECTRON 101
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The segment G1 X50 A50 Y50 is traveled with FEED=5000 on the path defined from X and A
but with a FEED > 5000 on the path defined by X Y and A, exactly with FEED=6124.
Let us see how the FEED value is computer.
Linear movement equivalent to the rotating movement of A axis (radius=57.29578):
DLA=DA * 57.29578 /57.29578 = DA = 50
DX = 50
DY = 50
The length of the X and A path is:
DLXA = sqrt(50*50+50*50) = 50*sqrt(2) = 70.7107 mm
The total length of the X, Y and A path is:
DL = sqrt(DX*DX+DY*DY+DA*DA) = SQRT(50*50+50*50+50*50)= 86.6025 mm
If we want to travel DLXA with a FEED of 5000, the FEED on the path related to all the three
programmed axes will be:
FEED = 5000 * 86.6025 / 70.7107 = 6124
The following table resumes some operating combinations of the functions G147, G147KA1 and
G148 for the control of the traveling velocity.
G147 G148
Case Programmed axes Effect
programming
102
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
At system startup and after a reset, the programming is activated according to the above table,
and depending on the setup data Axis alive at reset for the axes A and Y, decided by the machine
tool builder.
The status change (alive/not alive) of axes A and Y respect the following rules:
- The G28Y programming is always allowed, independently from the alive/not alive status of the
A and Y axes. After the G28Y programming, the programming of Y axis is activated.
- The G29Y programming is always allowed, independently from the alive/not alive status of the
A and Y axes. After the G29Y programming, both A and Y axes are set as alive. In this state the
axes A and Y cannot be programmed. If one is programmed, the alarm CN1D14 is triggered.
- The G28A programming is allowed only if the Y axis is not alive. After the G28A programming,
the programming of A axis is activated; if the Y programming was active (G28Y) and we want to
switch to the A programming, it is necessary to program G29Y G28A.
- The G29A programming is allowed only if the Y axis is not alive. After the G29A programming
the status of the axis A switches to not alive. Note: the G29A programming may be replaced in all
cases by G29Y, with the effect to switch both A and Y axes to the not alive status.
D. ELECTRON 103
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
WARNING: when the feature cylindrical axis is active, it is not possible the automatic activation
of A and Y axes with the programming of a movement, if they are in a not alive status.
As already told, if both A and Y axes are not alive, the programming of one movement
interesting them triggers the alarm CN1D14.
The displayed position of the cylindrical axis Y is always congruent with the radius set, also if the
Y programming is not active at the moment.
Rules and limits:
- The minimum radius programmable with G149 is 1 mm.
- The maximum radius programmable with G149 is 5729.775 mm.
- If a radius outside these limits is programmed, the alarm CN2C14 - NOT COMPATIBLE
PARAMETERS is issued.
- if the true axis A is a cyclic axis, after a reset, at system startup and after G149 programming
the position of the cylindrical axis Y is reduced inside a turn of the axis A position.
Let us clarify with an example:
true axis A with cyclicity = 360 degrees
cylindrical axis Y
radius of cylinder HR=57.295775 mm (this measure of the radius brings the displacement of 1
degree of the true rotating axis A to coincide with a linear displacement of 1 mm of the cylindrical
axis Y (because DY mm = DA degrees*HR/57.295775)
104
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
Program:
G149 HR57.295775
G28Y (activates axis Y programming)
G0 Y0 (brings Y to 0 mm)
G0 Y790 (displays Y=790, A=70)
Note: in this movement the axis A travels for 2 turns and 70 degrees (in fact 790=360*2+70).
At program end, reset is pressed.
After pressing reset, all complete turns traveled by the Y axis are recovered, while the position of
the Y axis is brought inside a turn of the axis A (to the value of 70).
The theoretical tool tip is the point where the tool is zeroed; the axis positions displayed on the
screen are always referred to the B point (theoretical tool tip).
D. ELECTRON 105
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
In order to machine a profile with radius correction, it is necessary to know the position of the
theoretical tool tip with respect to the tool center:
According to the preceding figures, the orientation codes are the following:G150KA0 =
deactivates the G150 and zeroes the allowance
G150KA1 = position 1. Tool tip oriented in direction Z- and X-
G150KA2 = position 2. Tool tip oriented in direction X-
G150KA3 = position 3. Tool tip oriented in direction Z+ and X-
G150KA4 = position 4. Tool tip oriented in direction Z+
G150KA5 = position 5. Tool tip oriented in direction Z+ and X+
G150KA6 = position 6. Tool tip oriented in direction X+
G150KA7 = position 7. Tool tip oriented in direction Z- and X+
G150KA8 = position 8. Tool tip oriented in direction Z-
When the radius correction is active, the displayed positions do not contain the corrections set
with G150, i.e. the virtual tool tip position is not displayed.
106
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
This feature allows, for example, in boring operations, at the end of which the spindle must be
stopped, to detach the tool from the machined wall: in these cases it is necessary to stop the
spindle without inverting its rotation direction (the tool may be broken or be damaged.
This type of positioning is achieved by programming G151 HT..(optional) on the line where M19
is programmed:
G151 M19 HT45 = requires a rough positioning, unidirectional with respect to the 45-degree
angle
M19 G151 = requires a rough unidirectional positioning with respect to the zero spindle angle
M19 = standard positioning
The G151 is valid only on the block where programmed (non modal).
D. ELECTRON 107
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
PROGRAM START%
G0 X100 Y90
G154
Also after a G154, the following movements are not counted:
- in G33/G84
- during the G36H (stop)
- in MDI
- movements requested by system subprograms (consequently, it is not possible to search
inside a system subprograms, normally considered as an atomic block).
The following important considerations must be taken into account in using the stored length:
- the operation of storing the length in retentive memory is always delayed for some
milliseconds, therefore, mainly with high machining speeds, the length stored when the
machining is resumed may be shorter that the effective length
- if G113X is active (corner rounding) and G154 is programmed on a corner, the length is
measured starting from the point nearest to the corner; it is therefore possible to have
differences between the length measured during the execution and the length computed in
block search if the corner is different in the two cases (possible difference in the starting
point). The difference in length between block search and execution is normally not greater
than 2 times RA (precision index of G113X).
108
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
The programming syntax is divided in many ISO lines (considering X the first axis horizontal -
of the raster area, Y the second axis vertical of the raster area, P1 the bottom left point, P2 the
bottom right point, P3 the top left point, P4 the top right point):
G155 HX1 "full path name of raster file"
G155 HX2 HR<X di P1> HT<Y di P1>
G155 HX3 HR(X di P2> HT<Y di P2>
G155 HX4 HR<(X di P3> HT<Y di P3>
G155 HX5 HR<X di P4> HT<Y di P4>
G155 HX6 HR<number of rows> HT<number of columns)
The deactivation syntax is
G155 HX0
The programming sequence of the ISO lines for the G155 must follow the HX order: G155 HX1,
G155 HX2, etc..., otherwise the error CN2C14 NOT COMPATIBLE PARAMETERS is issued.
G155 is not compatible with block search; the error CN8A14 G155 + BLOCK SEARCH is issued
if G155 is found during a block search.
The coordinates of the four points P1P4 delimiting the raster area are referred to the active
origin in use at the moment of programming.
The various ISO lines for the G155 programming may be interspersed with other ISO lines not
containing G155.
The raster file must be of the correct dimension, i.e. Nrows x Mcolumns bytes, otherwise the
alarm CN2C14 NOT COMPATIBLE PARAMETERS is issued.
If the specified raster file doesnt exist, the error CN2C14 NOT COMPATIBLE PARAMETERS is
issued.
The congruency of the coordinates of P1, P2, P3 and P4 defining the raster is not checked; it is
a programmer responsibility to fill the data in a coherent way in order to obtain a correct etching.
After a G155 HX6 programming the CNC is prepared to execute the movements during which
the laser will receive pulses according to the content of the raster file.
The etching is done by sending pulses to the laser when the head executes a movement along
an horizontal row of the raster area.
If the CNC has no more bytes left to drive the laser pulses during the etching movements, the
alarm CN2B13 is triggered (this may happen if the TSR Z32DG (DOS) or Z32WINDG (Windows)
doesnt read with sufficient speed the raster file; this situation however should never be found).
The etching may be done in unidirectional or bi-directional mode:
- in unidirectional mode the etching is made only when the axis travels from left to right, i.e. the
movements with etching on each row of the raster area start from the left of the row and proceed
toward right. Once all etching have been done on the traveled row, the axis goes to the subsequent
row, but after a repositioning on the row start (left side).
During this repositioning the coordinates of the working tern perpendicular to the plane of the
raster area may be raised by a defined quantity, called lift.
in bi-directional mode the etchings are executed during the movements traveling the first row
from left to right, the second row from right to left, and so on: the rows of the raster area are thus
st rd
etched on the left to right movements for odd numbered rows (1 , 3 , etc.) and on the right to left
nd th
movements for even numbered rows (2 , 4 , etc.). In this case there is no lift of the axis
perpendicular to the plane of the raster area.
All etching movements must be traveled with a constant feed, in order to correctly etch following
the percentages specified in the raster file: the first point of the row to be etched must thus be
D. ELECTRON 109
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
reached with a constant feed: the movement must then start not exactly on the point to be etched,
but a little bit before, in order to reach the point with the speed set for that point.
The space necessary to reach the constant speed will be called extra-stroke and will have an
entity depending on the programmed feed and on the dynamic parameters of the axes. It is a
programmers responsibility to set an adequate value of the extra-stroke (along the horizontal axis
of the raster area).
Once the G155 H6 is programmed, the CNC is ready to execute the movements driving the
laser pulses.
The CNC is informed of such movements, by inserting #Pn at the start of each movement
driving the laser, where n is the number of the row of the raster area traveled by the movement.
When the movement ends, the string #P0 must be inserted in the part-program to inform the CNC
that the subsequent movement will not drive any laser pulse.
N.B. #Pn contains a n value always positive in unidirectional etching, or a n value positive or
st rd
negative in bi-directional etching: n is positive on all odd rows (1 , 3 , etc.) and it is negative on all
nd th
even rows (2 , 4 , etc.) traveled in the reverse direction.
If a #P followed by a negative value appears in the movements programmed for a unidirectional
etching, the alarm CN2D13 is triggered.
The detailed implementation of the etching part-program can be quite difficult; D.Electron
delivers a macro capable to implement the behavior above described.
The macro will receive the following parameters:
ZFP[1] = EXTRA-STROKE in mm
ZFP[2] = LIFT FOR UNIDIRECTIONAL PASSES in mm
ZFP[3] = 0=BIDIRECTIONAL, 1=UNIDIRECTIONAL
ZFP[4] = X (first coordinate in mm) of P1 (bottom left point of raster area)
ZFP[5] = Y (second coordinate in mm) of P1 (bottom left point of raster area)
ZFP[6] = X (first coordinate in mm) of P2 (bottom right point of raster area)
ZFP[7] = Y (second coordinate in mm) of P2 (bottom right point of raster area)
ZFP[8] = X (first coordinate in mm) of P3 (top left point of raster area)
ZFP[9] = Y (second coordinate in mm) of P3 (top left point of raster area)
ZFP[10] = X (first coordinate in mm) of P4 (top right point of raster area)
ZFP[11] = Y (second coordinate in mm) of P4 (top right point of raster area)
ZFP[12] = NUMBER OF ROWS of raster area
ZFP[13] = NUMBER OF COLUMNS of raster area
ZFP[14] = Z WORKING POSITION in mm
The program calling this macro must program G155 HX1 followed by the name of the raster file,
before calling the macro.
N.B. The coordinates of the 4 points P1P4 delimiting the raster area are referred to the origin
active at the moment where the G155 rows are programmed; no origin change is thus allowed until
the G155 is deactivated.
WARNING: G155 is compatible with G117 and G118, but not with G116 and G118NHR1, also if
no alarm is issued if G155 is activated in these cases.
Example: let us suppose that the raster macro be contained in the file 201 of the CMOS
memory: in the case the calling program could be:
ZFP[1] 400 (extra-stroke)
110
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 111
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
112
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
Note: Reset and program execution start restore setting conditions, such as G160KA0.
G160 HT.. X.. Y.. Z.. (limits fast feed)
The HT parameter indicates the spindle maximum speed in turns/min
The spindle can only be the main one, otherwise HT programming has no effect.
Speed limit negative values are interpreted as zero values.
Along with G160 at least one of HT and axes names must be obligatorily programmed,
otherwise the CN2C14 INCOMPATIBLE PARAMETERS error is displayed.
The axis speed programmed values are in mm/min even if the machine is in inches.
If more G160 are programmed, unprogrammed entities (axes or spindle) remain each time with
the previous restrictions (setting ones or forced by a previous G160).
D. ELECTRON 113
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
where:
- XYZ = tapping end point
- K = thread pitch
- I [optional] = output speed multiplier (default 1)
- J = length of the single forward tapping segment (deep tapping)
- HX [optional] = J multiplier to obtain the backward movement length (default 1.5)
In the same line where G163 is programmed, the HY HR HT KA parameters are not permitted: if
there is one of these parameters, the CN2C14 incompatible parameters alarm is given.
Example:
G0 Z50 S1000 M3
G163 Z0 K1.5 I1.3 J10 HX2
requires deep tapping (50 mm between Z50 and Z0) with 1.5 thread pitch, consisting of:
- Forwards for 10 mm at S1000
- 20 mm backwards (because HX2) at S1300 (because I=1.3)
- Repetition until completion
Supplementary notes:
- If the thread cutting length is not at least K+0.005 (a turn + 5 microns), the CN2C14
INCOMPATIBLE PARAMETERS alarm is given.
- The STOP or FEED-HOLD button stops the spindle in G163.
- Forward tapping occurs per constant segments If J is not an exact sub-multiple of the tapping
depth, J is automatically changed, by adding 20% max, and then by subtracting as much as is
needed to reach an exact sub-multiple of the required depth.
- If the backward movement results in a retraction position beyond the starting point (Z50 in the
example), retraction is limited to the initial dimension.
- If J<(2*K) (including J<0), the CN2C14 INCOMPATIBLE PARAMETERS is displayed.
Special behaviour when pressing the STOP button
With appropriate machine settings, a special behaviour can be activated if the STOP button is
pressed during tapping, in particular:
- Do not temporarily acquire the STOP command
- Immediately reverse the spindle rotation (or keep the spindle in reverse rotation if already
present), and remove the tool from the hole until tapping is started before stopping the execution.
For details, please refer to the specifications given by the machine manufacturer.
114
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 115
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
2.1.119 G200 HX6 / G200 HX7 - low search feed change in G61
The low search feed in G61 is defined in machine setup.
With this function the low search feed may be modified by the part-program. Example:
G200 HX6 HY500
After this instruction, the low search feed in G61 becomes the 50% of setup feed.
The search feed defined in setup is multiplied by HY/1000.
HX must be programmed in the same line as G200, while HY may also be defined in preceding
lines. Example:
HY500
G200 HX6
Valid range for HY is from 0 to 1500. Therefore with G200 HX6, the low search feed defined in
setup may be decreased up to zero (in this case the search movement is not executed) or
increased up to 50%.
Values external to this range are limited to the extremes, therefore negative HY values act as
zero, while values greater than 1500 act as 1500.
The forcing of low search speed remains until part-program end, and is canceled by a reset or
program start.
The forcing is deactivated (and setup value is restored) with:
G200 HX7
or with:
G200 HX6 HY1000
2.1.120 G200 HX8 / G200 HX9 - rigid tapping without spindle inversion
The rigid tapping function G63 considers the tool axis as always rigidly locked to the spindle,
which must invert its rotation at the end of the tapping, in order to return to the starting position.
Since some time, special fixtures exist, allowing a semi-rigid tapping with automatic rotation
direction inversion, thus avoiding the need to invert the spindle rotation.
Using these fixtures, the tapping cycle must be:
a) spindle rotation
b) starting of tapping axis and locking to the spindle rotation
c) tapping feed
116
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
d) axis inversion, without spindle inversion, with temporary sync loss and new lock in the
opposite direction
e) return to the starting point
It is possible to force the execution of this cycle, by programming G200 HX8 before G63, and to
return to the execution of standard tapping with G200 HX9. Example:
T57M6 (THREADING TAP WITH INVERSION, PITCH 2)
G200 HX8
...
G63 Z-50 K2
...
G63 Z-50 K2
...
T58M6 (RIGID THREADING TAP, PITCH 1)
G200 HX9
...
G63 Z-80 K1
...
At RESET and program beginning, the standard mode is active (rigid tapping with spindle
inversion, G200 HX9).
G200 HX8 is a modal function: it remains active until reset and may be deactivated with G200
HX9.
When G200 HX8 is active, the axis inversion time is double with respect to the soft approach
time defined in setup for the G63, because during the inversion a feed step from positive to
negative is generated, the double of the starting feed step going from zero to the positive feed.
2.1.122 G200 HX11 / G200 HX12 - precise G4 dwell mode under G113X
This function has been developed for laser cutting machines, but it may also be used for other
purposes.
The time for G4 dwell is programmed with the parameter TT.
D. ELECTRON 117
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
If G113X is active, the programmed dwell time is elongated for a total time of about 140
milliseconds, due to internal computing times; furthermore the dwell time has an uncertainty which
can be up to 24 ms, due to the internal state synchronization.
That means that the minimum dwell time obtainable by programming TT0 is about 140 ms.
Because this time may not be usable for very short dwell times, a precise dwell mode has been
introduced: this mode can be activated by the part-program with G200HX11 and disabled with G200
HX12.
G200 HX11 / G200 HX12 are modal, non stopping functions.
For compatibility with existing part-programs, after reset and at program start, the standard
mode (as G200 HX12) is enabled.
With the precise dwell mode, the uncertainty (variations in the dwell time) are eliminated, and it
is possible to obtain very short dwell times with a resolution of 2 ms.
Part-program example:
...
G200 HX11
...
G4 TT0,002 (precise dwell of about 2 milliseconds)
...
G200 HX12
...
G4 TT0,002 (dwell of about 142 milliseconds with 24 ms uncertainty)
NOTE: The G200HX11 precise G4 dwell mode with G113X is reserved for special cases for
which G136 (microdwell) can be alternatively used. With the precise dwell mode, G4 becomes (like
G136) a non stopping function. This can lead to a time lag between the displayed line and the one
in progress.
2.1.123 G200 HX13 / G200 HX14 - for backward compatibility with Z16
Warning: these functions must be used only in strict coordination with the machine tool
builder in special cases where a backward compatibility with Z16 is required.
G200 HX13 activates the Z16 mode for G98, while G200 HX14 deactivates it. Both G200HX13
and G200HX14 are stopping functions.
After reset and at program start, the G200HX13 is automatically canceled.
The purpose of the function is to obtain a backward compatibility with Z16 in G98 (obsolete
mode for movement control).
For further details, refer to the machine tool builder specifications.
2.1.124 G200 HX15 / G200 HX16 - eliminates the apparent RA increase for small-
diameter circles
This feature is particularly useful for laser cutting machines.
The RA parameter programmed in the line with G114 is used, with an active G113X, to soften
the programmed profile. The RA effect occurs as follows:
- On edges (where softening is more useful), the path deviation can be several times RA
- On large-diameter circles (>100 times RA), the path deviation is approximately equal to RA
118
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
- On small-diameter circles (<100 times RA), the path deviation is gradually increased so as to
obtain that any rounded edge with a circular interpolation having a very small radius is made at
least as soft as a real edge.
This apparent RA gradual increase can be harmful in laser cutting machines when they are
required to make circles (holes) with very small diameters, because the reduction in diameter may
become unacceptable.
The G200 HX15 preparation function (cancelled by G200 HX16) has thus been introduced to
eliminate the RA apparent increase on small-diameter circular segments.
G200 HX15 is provided with partial stop, that is it cannot be programmed during radius
correction or with an open profile (an incompatible profile error is displayed), but does not cause a
pause.
2.1.127 G241 - G242 - positioning on the initial point of future radius correction
Some applications, mainly on cutting machines, there is the problem to position the axes on the
starting point of a future radius correction, before to activate the radius correction, because an
D. ELECTRON 119
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
undefined quantity of operations, also stopping operations, movements in the vertical directions,
etc. must be executed on the starting point.
From a geometrical point of view, the necessary operations are:
- find the first point of the future profile to be executed with radius correction
- compute the displacement based on the slope of the first segment of the future profile
- command a movement to the corrected point calculated
These operations were possible also with previous versions of Z32, but there was the difficulty
posed by the slope, normally unknown because it depends on the first segment of the future profile.
The two new part-program functions G241 and G242 allow to solve this difficulty. The syntax is:
G241 X Y HX
G242 X Y HX
Where:
- X, Y are the initial coordinates of the future profile with radius correction (reached with a G1
movement)
- HX expresses the line number of the first segment with radius correction, starting from XY
and having the unknown slope.
In order to avoid confusion with the line numbers automatically generated in the part-programs
by CAM systems, the line number contained in the HX parameter is special, because it is
expressed by the number contained in the HX parameter (up to 3 decimal digits), preceded by two
supplementary zero. Examples:
N001 line number defined by HX1
N001,3 line number defined by HX1,3
N001,3 line number defined by HX1.3
N00104 line number defined by HX104
N000 line number defined by HX0
Please note that the decimal separation character may be a dot or a comma in the HX
programming, but must be a comma in the N programming.
Alike the GON jumps, the part-program doesnt contain two identical N00, otherwise the first is
found.
The N must be programmed at line start and must be followed by a blank or a numeric
character.
Programming example:
... (tool radius R=2)
N1 G241 X10 Y5 HX4
... (programming of M, Z, G112, G4 )
N10 G41 (start of radius correction)
N11 X10 Y5 (profile starting point)
N004 G1 X20 Y5 (first profile segment)
... (profile)
Execution:
- reading of the line N1 and jump to the line N004
- analysis of the N004 line to detect the initial slope of the segment starting from the initial
point programmed in N1 and terminating in the end point programmed in N004
120
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
X
G150KA3 G150KA1
TAG TAG
TAG TAG
G150KA5 G150KA7
D. ELECTRON 121
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
NOTE: The figure refers to a working surface in which the first axis is the Z axis, and the second
axis is the X axis, that is to a G25ZX working plane. Orientation codes are in fact intended as
referring to the working plane. If the working plane is different from the ZX plane (XZ for example),
the upper figure should be redone with the horizontal axis equal to the first axis of the plane (X), and
the vertical axis equal to the second axis of the plane (Z).
Other tool directions are not supported by the feature.
- The TAG part-program three-character parameter must be defined (it can also be entered into
the tool table) that specifies the minimum tool gouge angle in degrees. The TAG angle is the angle
between the tool part subject to gouge, and the first axis of the working plane. The TAG parameter
is zeroed at reset.
- The R tool radius for the profile radius correction must be defined (if radius correction is not
desired, R0 must be programmed).
Restrictions and alarm conditions:
- This feature can be used only on a lathe machine
- By programming G410/G420 without one among G150KA1/KA3/KA5/KA7 being active, the
CN1D14 error occurs.
- With G410/G420, only the movements of the first and second axis of the plane can be
programmed, otherwise the CN1D14 error occurs.
Operation:
Once G410 (or G420) has been activated during the execution of a profile with radius correction,
the CN takes into account the tool gouge angle and eliminates the profile segments which cannot
be machined.
The operation is quite similar to that of a profile with radius correction:
G410 activates a G41 plus "Tool anti-gouge floating"
G420 activates a G42 plus "Tool anti-gouge floating"
G40 defines the end of the profile with radius correction via "Tool anti-gouge floating"
The G0 function defines the profile end.
Notes:
- In the case of G410/G420 (Tool anti-gouge floating), the simulation geometric blocks are those
generated before any processing due to anti-gouge floating, that is the original geometric blocks.
- The TAG three-character parameter, which specifies the minimum tool gouge angle, can be
programmed both by part-program and the tool table.
- The TAG parameter possibly contained in the tool description can be accessed from an
evolved line in the part-program, both in reading (:R, :C) and in writing (:W, :S) mode.
Example of a profile obtained with a sharp-edged tool (tool radius = 0):
G0Z0X210
TAG30 (TAG can be entered into tool table and not programmed)
R0 (R can be entered into tool table and not programmed)
G150KA1
G420 X
G1Z0X200 G150KA1
Z-20
TAG
X180
Z-40
X210 Z
122
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
G3I-50J210Z-60X210
G3I-70J210Z-80X210
Z-95
G40
In the figure, the following can be observed:
- The original profile
- The path of the tool tip
- Unmachined shadow areas
Example of a profile with tool radius other than zero:
G0Z0X210
TAG30 (TAG can be entered into tool table and not programmed)
R5 (R can be entered into tool table and not programmed)
G150KA1
G420
G1Z0X200
X
Z-20
X180 G150KA1
Z-40
TAG
X210
G3I-50J210Z-
60X210
G3I-70J210Z- Z
80X210
Z-95
G40
In the previous figure, the combined effect of the radius correction and tool gouge checking can
be observed.
In the figure, the following can be observed:
- The original profile
- The path of the radiused sector centre.
- The unmachined shadow areas
D. ELECTRON 123
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
124
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
updates all ZFP corresponding to programmed parameters, reads from disk the cycle Cn, loads
it in subtemp 65 and activates it.
G800 KA0
clears all parameters reserved to G800: ZFP[550]-ZFP[599]
G800 [MHA.. MHB..]
updates all ZFP corresponding to programmed parameters
G800K0
equivalent to G27C0 + G800KA0, i.e. deactivates the canned cycle and resets all parameters
associated with G800 (ZFP[550] ZFP[599])
G800 KA1
Associates the values of the AA, AB, AC parameters to the axes programmed (in that order) on
the G881-G899 or G901-G999 line, in its turn calling the macro where the G800 KA1 is
programmed.
G800 KA2
Associates the values of the AA, AB, AC parameters to the axes programmed with the last
G881-G899.
Rules and limits:
- if other parameters, different from those listed above (G, M etc....), are programmed in the
same line as G800, the alarm CN1D14 PROGRAM ERROR is issued
- G800 must be programmed at the beginning of the ISO line, only the line number and/or blank
characters may precede it
G800 K1 MHB100 correct programming
G800 K1 MHB100 correct programming
K1 G800 MHB100 program error (CN1D14)
- if KA0, KA1, KA2 or K0 is programmed, no other parameter can be programmed on the line,
otherwise the alarm CN1D14 PROGRAM ERROR is issued:
G800 KA0 correct programming
G800 KA0 MHA100 program error (CN1D14)
G800 K1 KA0 program error (CN1D14)
- the value of E, I, J, NA-NZ and MHA-MHZ parameters may be expressed with a number or
with a valid Z32 expression (all E, I, J, NA-NZ and MHA-MHZ are Z32 float)
- the value of K parameter (number of canned cycle to be loaded from disk) may only be
expressed with an integer number ranging from 1 to 9999 and not with an expression; if the number
specified is fractional, only the integer part is accepted, without signaling any error
- G800 KA1 and G800 KA2 may be programmed only inside a cycle/macro called through G881-
G899 or G901-G999, otherwise the error CN1D14 is issued
- the value of KA parameter may be equal to 0,1, or 2 and may be expressed only with a number
and not with an expression
- inside cycles/macros programmed with G800/G801/G802, G881/899 and G901/999 it is
allowed to program G800 KA0, G801 KA0, G802 KA0, G881-G899 KA0, G901-G999 KA0; in
cycles/macros programmed with G881/G889 and G901/G999 it is allowed to program G800 KA1
and G800 KA2. No other type of programming of these G functions is allowed, otherwise the error
CN1D14 is issued.
- if an attempt is made to load a canned cycle not existent on the hard disk, the error CN8214
G800/1/2 PC FILE ERROR is issued
D. ELECTRON 125
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
- if an attempt is made to load from the hard disk a canned cycle too large for the available
subtemp memory, the alarm CN8314 G800/1/2 MEMORY FULL is issued
- N.B. During the execution of a canned cycle called through G800, the lines of the cycle are not
displayed.
126
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 127
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
HX1 asks to recall the machining macro as a canned cycle: in this case the macro handling is
the same of a canned cycle (loaded in subtemp 65 and activated with an implicit G27S65). This
setting allows to connect a macro to a positioning cycle.
HX0 = asks to recall the macro as a machining macro; equivalent to omit the HX programming
ContinuousAxesNames = with G802 it is possible to program one or more continuous axes as
parameters (i.e. by programming Y126, the Y axis is not moved, but the Y parameter assumes the
value 126 instead). With ContinousAxesNames it is possible to program also the parameters AA,
AB, AC, respectively corresponding to the first, second and third axis of the active working tern.
G802 may be programmed in 5 different modes:
G802 Kn [MMA.. MMD.. Axes..]
updates all ZFP corresponding to programmed parameters, reads from disk the Mn macro,
loads it in subtemp 67 and recalls it, starting its execution. Programs one or more continuous axes
as parameters.
G802 Kn HX1 [MMA.. MMD.. Axes..]
updates all ZFP corresponding to programmed parameters, reads from disk the Mn macro,
loads it in subtemp 65 and recalls it, activated as a canned cycle. Programs one or more continuous
axes as parameters. When G802 with HX1 is programmed, ZFP[700] is set to 1; ZFP[700] returns
to zero only when a G802 without K parameter is programmed, or if G802KA0 or G802K0 is
programmed.
G802 KA0
clears all parameters reserved to G802: ZFP[650]-ZFP[699] and the parameter ZFP[700] (G802
HX1)
G802K0
equivalent to G27C0 + G802KA0, i.e. deactivates the canned cycle and resets all parameters
associated with G802 (ZFP[650] - ZFP[699]) and the ZFP[700] parameter (G802 HX1)
G802 [MMA.. MMB.. Axes..]
updates all ZFP corresponding to programmed parameters and clears the parameter ZFP[700]
(G802 HX1)
Rules and limits:
- if other parameters, different from those listed above (G, M etc....), are programmed in the
same line as G802, the alarm CN1D14 PROGRAM ERROR is issued
- G802 must be programmed at the beginning of the ISO line, only the line number and/or blank
characters may precede it
G802 K1 MMB100 correct programming
G802 K1 HX1 MMB100 correct programming
K1 G802 MMB100 program error (CN1D14)
- if KA0 or K0 is programmed, no other parameter can be programmed on the line, otherwise the
alarm CN1D14 PROGRAM ERROR is issued:
G802 KA0 correct programming
G802 KA0 MMA100 program error (CN1D14)
G802 K1 KA0 program error (CN1D14)
- HX1 may be programmed only if K is also programmed in the line, otherwise the alarm
CN1D14 PROGRAM ERROR is issued.
G802 K2 HX1 correct programming
G802 HX1 program error (CN1D14)
128
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
- the value of E, I, J, NA-NZ and MMA-MMZ parameters may be expressed with a number or
with a valid Z32 expression (all E, I, J, NA-NZ and MMA-MMZ are Z32 float)
- the value of continuous axes programmed as parameters may be expressed with a number or
a valid Z32 expression
- the value of K parameter (number of macro to be loaded from disk) may only be expressed
with an integer number ranging from 1 to 9999 and not with an expression; if the number specified
is fractional, only the integer part is accepted, without signaling any error
- the value of KA parameter must always be equal to zero and may be expressed only with the
number 0 and not with an expression
- the value of HX parameter may be 0 or 1, and must be expressed only with the numbers 0 and
1 (no expressions allowed)
- inside cycles/macros programmed with G800/G801/G802, G881/899 and G901/999 it is
allowed to program G800 KA0, G801 KA0, G802 KA0, G881-G899 KA0, G901-G999 KA0; in
cycles/macros programmed with G881/G889 and G901/G999 it is allowed to program G800 KA1
and G800 KA2. No other type of programming of these G functions is allowed, otherwise the error
CN1D14 is issued.
- if an attempt is made to load a macro not existent on the hard disk, the error CN8214 G800/1/2
PC FILE ERROR is issued
- if an attempt is made to load from the hard disk a macro too large for the available subtemp
memory, the alarm CN8314 G800/1/2 MEMORY FULL is issued
- N.B. During the execution of a machining macro called through G802, the lines of the macro
are not displayed.
D. ELECTRON 129
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
130
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 131
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
A nested G9xx is associated with subtemp 68 (i.e., the associated macro is loaded into subtemp
68).
132
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
CHAPTER 3
3.1.1 M ISO
M0 - stop
Stops the execution of the program that can be resumed by pressing the start button.
Requires spindle stop and coolant stop.
M1 - conditional stop
Similar to M0, except that the effectiveness of M1 is conditioned by a special input of PLC:
contact the manufacturer of the machine tool for further details.
Requires spindle stop and coolant stop.
D. ELECTRON 133
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
M2 - end of program
Exit the CNC from EXECUTION mode and closes automatic operations
M3 - spindle clockwise
Requires spindle rotation to be clockwise at the S speed previously programmed
M4 - spindle counter-clockwise
Requires spindle rotation to be counter-clockwise at the S speed previously programmed
M5 - spindle stop
Requires the spindle to stop.
Stops the coolants as well.
M6 - tool change
Requires that the tool (programmed as T in the same block or in previous blocks) be
mounted on the spindle.
Stops the spindle and the coolants
NOTE: for lathe systems, programming an M6 does not stop spindle and coolants.
After execution (not in block search) of an M6, the N/C acquires the description of the tool
mounted on the spindle then updates the parameters accordingly.
The updating of parameters in tool description occurs on exiting (G26) the tool change
subprogram (also see tool management)
M7 - dispense coolant n. 1
Requires that coolant n. 1 be dispensed.
M8 - dispense coolant n. 2
Requires that coolant n. 2 be dispensed.
M9 - stop coolants
Requires that coolant dispensing be stopped
M19 - spindle indexing
Requires that the spindle be indexed (oriented).
Also requires spindle and coolants stop
3.1.2 Special MS
The manufacturer of the machine tool can define up to 48 special Ms. When the Z32 must
perform a special M, it leaves the execution of the current line and jumps to a special M
subprogram written by the manufacturer of the machine tool.
If the line contains other functions that should be executed after the special M, these functions
are not executed. Once the subprogram associated to the special M is finished, the program
resumes from the beginning of the next line.
Some M that have been already decoded and partially controlled by Z32 cannot be defined as
special Ms; these are:
M3, M4
M7, M8, M9
M19, M5
M0, M1, M2.
When the subprogram associated to special M is running, the progressive counter is blocked
Block counter (that is, during block search, special M is seen as one block that cannot be resumed at an
stop intermediate point.
Display not
updated Even the display of the current line is suspended during a special M unless the Z32 has been
put in service mode through the special procedure (see Instruction manual - M95).
The subprogram associated to the special M can be executed in single block.
134
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
A special M can also be called from within a canned user or system cycle or from within another
special M. For example, it is possible to create a canned cycle containing the check of tool integrity
and to call tool change (M6 is special) even from within the canned cycle.
10 nesting The Z32 features up to 10 levels of nesting of jump and return.
levels
Each of the following operations counts as a level:
GON-N jump to a series of lines with return
GOP jump to a subprogram with return
special M
canned system or user cycle
Manufacturers Two levels are used by G110 (rough-machining macro-functions)
notes
Beyond the available levels there is the error: CN2E14 TOO MANY SUBROUTINES
Since special Ms are a typical means used by the machine tool manufacturer to personalize the
N/C, please refer to the information supplied by the manufacturer for a complete list and information
on the use of the special Ms.
3.3 FEED
According to ISO standards, address F is assigned the meaning of feedrate.
The feed is expressed in displayed integers per minute at the reset with G94, while with G95, it
is expressed in displayed integers per revolution, and with G93 it is expressed as the inverse of the
time (in min) necessary to execute the motion.
For example, in the case of linear axes with display in millimetres (and micron decimals),
programming F100 means 100 millimetres/minute.
In the case of rotary axes with display in degrees (and thousandths of degree), programming
F100 means 1000 degrees/minute.
D. ELECTRON 135
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
As is the case of any other parameters, F can be programmed with 9 significant digits before or
after the decimal comma or point. However, F has also the effect of setting the machining feedrate:
since the feedrates set must never exceed rapid feedrate, the N/C will limit the physical feedrate of
the axes according to the rapid feedrate of the axes involved in the movement and according to the
programmed movement.
In brief:
- during movements in G1, with override at 100%, and taking into account the inclination
of the movement, no axis must exceed the rapid feedrate divided by 1.2 (with override at
120%, the feedrate cannot exceed the rapid).
- During movement in G2/G3, the feed with 100% override cannot exceed the lowest of
the rapids of the axes of the working plan
Also see chapter Preliminary G functions, paragraphs regarding G1 and G2/G3.
The limits affect only the physical feedrate of the axes and not the F parameter that retains the
value programmed.
For example, the axes have:
X with rapid at 15 m/min
Y with rapid at 15 m/min
Z with rapid at 10 m/min
The following program generates the feedrates (on the path and with override at 100%) as
described in the comment:
...
N10 G0 X0 Y0 Z0
N11 G1 F5000 X100 Y100 Z100 (5000 mm/min)
N12 F10000 X0 Y0 (10000 mm/min)
N13 Z100 (8333 mm/min)
N14 X100 (10000 mm/min)
N15 F99000 X200 (12500 mm/min)
...
The minimum interpolation feedrate increment is about 0.01 units/minute (that is, 0.01
mm/minute in the case of linear axes).
3.4 SPEED
S is the spindle speed
As a parameter, S can be programmed with 9 significant digits, either before or after the decimal
comma or point.
The actual spindle speed is determined by the PLC.
Also refer to the information supplied by the manufacturer of the machine tool.
136
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
The numeric index for two letter axes must be a digit in the range 1-9.
The programming of axes with a two letter name needs a particular syntax; further details in the
paragraph Axes with two letters name (numeric index).
Axis dimensions are programmed using the axis name (one or more characters identifying a
continuous axis in the machine settings) followed by a numeric value.
As a parameter, the dimensions can be programmed with 9 significant digits, either before or
after the decimal comma or point: one or more than one axes are driven outside from the working
field admitted by the machine, the CNC will signal an end of travel error.
Axis dimensions are programmed using the same units as the displayed integers.
For example, in the case of linear axes where millimetres (and microns as third decimal) are
displayed, programming X100,25 means programming 100,25 millimetres.
In the case of rotary axes where degrees (and thousandths of degree) are displayed,
programming A10.47 means programming 10.47 degrees.
On the same machine axes, even when simultaneously active, can be defined using different
units (for example, millimetres for linear axes and degrees for rotary axes).
The three axes of the machining triad can be programmed using their names (for example X, Y,
Z, etc.) or respectively as:
AA... first axis of the machining triad
AB... second axis of the machining triad
AC... third axis of the machining triad
For example if at a certain point of the execution of a program, the XYZ triad is active (that is,
G25XYZ), programming AA100 AC125 is the same as programming X100 Z125.
If, on the contrary, the ZXY triad were active (G25ZXY) it would have been the same as
programming Z100 Y125. This opportunity is very useful for canned cycles and for standard
subprograms that can be completely defined in generic form regardless of the machining triad in
which they will be used.
Also see chapter Preliminary G Functions, paragraph on G25 Working Triad - for more
information on axes orientation.
D. ELECTRON 137
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
The axis Y goes to position 20, Y2 goes to position 100, X1 goes to position 25.3 (for syntactic
coherence the separation character = is mandatory in the programming of two letters axes
names)
G0 X_1=<X_1+3>
Axis X1 increases its position by 3 (inside an expression in a ISO line, the axis is defined with
letter, underscore, index and must not be followed by the separator =).
!X_1=X_1-Y_2+R!
The parameter associated with the axis X1 is assigned with the value of the expression (in an
advanced line the = character used for assignments is sufficient to individuate the two letters axis
name, while in the expressions contained in advanced lines the syntax is identical to the ISO lines
expressions.
G0 X_1=1,35 _X12
The axis X1 goes to position 1.35; the value 12 is assigned to the parameter _X
G0 X_1=1,35 X_12
This programming is not allowed (it is not possible to program two characters parameters whose
second character is _ if one or more two letter axes are defined in the setup of the machine).
Tool A further modification to these figures is the tool length (L parameter milling systems, LX and LZ
parameters in lathe systems) that has effect only on one axis for milling machines (at reset it is the
length
third axis of the working triad and can be modified using G43/G44) or on two axes for lathes (axes
X and Z after reset); for the axes ahere the correction is active, the displayed position is referred to
the tool tip.
The general situation of axis quote is represented in the figure below.
SUPPLEMENTARY ORIGIN
PROGRAMMED POINT
BASE ORIGIN
TRANSDUCERS ZERO
138
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
3.7.1 Origins
Address O informs Z32 that an additional origin has been programmed.
After O, no numeric value must be programmed but, as explained later, a combination of letters
and numbers identifying the origin to be activated.
The origin of interest to the programmer can be, for example, a point to which the
measurements of the drawing refer. This origin may also vary even within the same program, for
example because two different workpieces mounted on the same table or different faces of a piece
are to be machined, etc.
The programmed distance values must always be referred to that origin. The working origins
available for the programmer (SUPPLEMENTARY ORIGINS) are contained in the origin table that
can be found in the global number 126 file, or as a local section at the end of the part-program.
Origins in The global section is active upon reset and can be restored using G37OG. The various local
table sections are enabled by entering G37OL in the program or subprogram containing the section that
Local is to be activated.
origins Please note that if G37 and the origin are programmed in the same line, G37 must precede
the origin:
N1 G37OL OX1
The X1 origin is read in the local file.
An origin section, either global or local, starts the line with :OS
The following lines define each origin, which are identified by the axis name to which they refer
followed by
- any printable character, except space and zero (reserved to the base origin only).
- two or three numeric digits; the first digit must be different from zero
For example, we can define:
:OS
X1=20,47
Y4=+17,381
Y?=-11
XA=-318,963
Z431=108,8
Y16=-58
The origin is acknowledged only if the origin string (for example Y1=32.5) is at the beginning of
the line or is preceded only by blanks.
The definition of the origin terminates with the first blank or open round bracket or end of line
characters (0dh), any other successive character is ignored.
For each axis and for each program about 1148 different origins can therefore be defined.
The printable characters can be any of the following:
a) 9 numbers
b) 26 alphabetical characters
c) about another 25 characters such as + - ;# ( and others)
We do not recommend using an asterisk "*" as this has the meaning of active origin during
reading and writing (:R and :W, see evolved lines).
The origin table uses memory according to its content and undefined origins do not occupy any
memory.
D. ELECTRON 139
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
To make things easier for the operator, the origin table can be preceded by a description or by a
comment.
This is an example of origin table:
SUPPLEMENTARY ORIGIN TABLE-PIECE 4782-
:OS
X1=20,47
Y4=+17,381
Y?=-11
XA=-318,963
.....
Programming To call origins within a program, the following must be programmed:
the letter O
the name of the axis involved
the characters identifying the origin
For example, if the above origins table is present and active, program: OX1 OY1 means to relate
X axis dimensions to point X = 381 and Y axis dimensions to Y point = -27.38.
The origins with digits can be programmed using an expression, i.e. the origin number may be
the result of an expression, for example:
OX<1> is equal to OX1
OY<20+3> is equal to OY23
HX340 OZ<HX+5> is equal to OZ345
When programming the origins, a stop is required (please refer to chapter Preliminary G
functions paragraph G functions).
At reset or power on, the following can be active depending on the machine settings:
zero origins (base)
the last active origins
origins 1 (OX1 etc.) on all the axes.
To cancel the supplementary origin correction the zero origin can be programmed. For example,
the command OX0 OY0 means: cancel the supplementary origins regarding axes X and Y: after
this instruction the NC refers the dimensions of these axes to the base origin.
Even if already defined in the origin table, for example X0=100, as soon as the CNC encounters
an OX0 instruction, it will cancel the additional origins and ignore any OX0 defined in the origin
table.
Function G53 (that is cancelled by G54) stops the effect of the supplementary origins and
activates the base ones.
It is possible to save and restore the active origins also if their name is unknown; for further
details see the G152 KA1 and G153 KA1 functions.
140
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
oX18
Does not enable OX18 and does not give any alarm if OX18 does not exist.
D. ELECTRON 141
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
- If for one or more axes, the requested origin does not exist in the table, no alarm is given and
the origin is still the previous one.
142
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
D. ELECTRON 143
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
In position display, LX is recomputed if LX or DLX are programmed in a ISO line (but not if
programmed in an evolved line, as explained for L in the paragraph Tool length); it is therefore
better to always program DLX in a ISO line to immediately obtain its full functionality.
The above discussion related to LX apply also to the display of LZ: it is preferable to program
DLZ in a ISO line to immediately obtain its full functionality.
The DLX and DLZ parameters contained in the tool description can be accessed by an evolved
line in the part-program, both in reading (:R, :C) and in writing (:W, :S) mode.
3.7.9 LEF and REF actual value Length and tool Radius
LEF returns the actual value of the L tool length, consisting of L+DDL.
REF returns the actual value of the R tool radius, consisting of R+DDR.
Example of use:
HA=LEF+5
HA assumes the value of L+DDL+5
Since LEF and REF are not parameters but values obtained with a calculation, it is not possible
to change their value, and any attempt to do so generates a CN1D14 PROGRAM ERROR.
3.8 PARAMETERS
As already mentioned, many machine functions are programmed using one or two alphabetical
characters followed by a numeric value, for example: X100.
Besides the above-listed addresses corresponding to special functions many other two-letter
combinations are possible. These addresses identify an entity we shall call a parameter the value
of which is stored in the Z32 memory for later use.
The addresses of specific machine functions (except for N, G, O) also correspond to numeric
values in the Z32 memory. These are updated as the program is running. These entities too can be
considered parameters.
In the example, after analysing the X100 instruction (also see chapter Execution of an ISO
line), the Z32 will contain the value 100 in the location assigned to X. The programming of X also
implies that the X axis will have to be moved, but, in the meantime, the programmed value was
written in the location corresponding to X.
The value of 100 assigned to the X parameter is stored in the memory of the Z32 until a different
value is assigned to X, and can therefore be used later for other scopes than making the axis go to
the distance 100.
The parameters are identified by an address (X in the previous example) that can have 1, 2 or
3 characters or by parameters having a PAR[ ], PAL[ ], etc index. In the Z32 memory, there are
locations for the following groups of parameters:
1) AXES NAMES
2) SYSTEM PARAMETERS
3) USERS PARAMETERS
4) PARAMETERS WITH INDEX
5) THREE LETTERS PARAMETERS
Except the parameter array PRM[ ], unique for all the processes, all other parameters are
process parameters, i.e. available for each process.
144
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
D. ELECTRON 145
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
D.ELECTRON may define other parameters in the future to extend the software performances
of the Z32.
146
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
Max 60 The operator can define a maximum of 60 literal parameters inside a part-program (formed of
parameters one or two alphabetic characters) and parameters with index as described in the next paragraph.
Parameter symbols can be a combination of one or two printable characters, except for:
Parameters BLANK cannot be used
in letters
NUMBERS cannot be used
characters ! $ % ( ) * + , - . / ; < = > cannot be used.
the first character must not be any of the following ones: G N O
the following combinations are forbidden, because they have other meanings:
AA AB AC first axis, second axis, third axis
RQ SN CS AT square root, sin, cos, arc-tang.
PI PI constant (=3,14159)
PC CP Cartesian/polar conversion and inverse
IF conditioning
EB evolved line interruption
- capital letters are accepted (though not recommended for clarity reasons).
- if two letters axes names are defined in setup, the second character cannot be an _
(underscore) character.
To avoid problems, we suggest using for parameters alphabetical letters only.
Numerous other combinations are possible: some of these are used by the manufacturer of the
machine tool for canned cycles, standard sub-programs, macro-instructions, etc. The operator can
use these sub-programs as they are, without problems, provided the symbols used in the said sub-
programs are not used in the main programs that use them.
In case of canned cycle, we have the following meanings:
HA hole beginning
HB hole end
HC long exit hole
HD working diameter
HE canned cycle internal use
HF canned cycle internal use
HG canned cycle internal use
HH canned cycle internal use
HJ canned cycle internal use
D.ELECTRON will possibly use symbols beginning with H in standard subprograms.
The final user can use symbols used in sub-programs, but he must know that, after executing
the sub-program, values pertaining to these parameters will be modified. (Therefore not
recommended).
D. ELECTRON 147
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
The index locating the parameter can be an arithmetic expression (the same syntax and the
same functions as the arithmetic expressions of evolved lines and in acute brackets. (See the
following paragraph).
For example, the following syntax is correct (but it is better to avoid excessively complex syntax):
!HX=12*HA/PAR[HA+PAR[HB+1]]!
If the programmed index is not an integer, the nearest element of the array is addressed (that is,
the calculated index is rounded off to the nearest integer).
If the programmed index is greater than 512 or smaller than 0 the programming alarm INDEX
NOT VALID is triggered.
If an element PRM[n] is accessed with n greater than the allowed limit, the alarm CN1D14
PROGRAM ERROR is issued.
148
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
If an error is detected during the writing of a PRM[ ] parameter in the CMOS memory, the alarm
CN2713 - PRM[ ] CMOS WRITING ERROR is issued.
In case of errors detected after power on in the values stored in the retentive memory for PRM[ ]
parameters, the alarm CN0x10 is issued (where x is a hex digit greater than 7 - possible values
8,9,A,B,C,D,E,F).
The errors CN0x10 are normally caused by a discharged or defective backup battery, used to
maintain the retentive data during system shutdown. These alarms must be handled by the service
personnel.
WARNING: the PRM parameters are special parameters which cannot be used for
mathematical formulas. The PRM parameters (from the part-program point of view) are
treated as integer numbers truncated to the third decimal digit (also during the
computations).
For example: the expression PRM[4]< 1 / 10000 > bring to a 0 result. The correct result
should be 0.0001, but the final result will be 0 because of the truncation to the third decimal
digit.
For this reason, the PRM parameters may be used to store data, values or setup values,
but they are not suitable to be used in mathematical calculations.
D. ELECTRON 149
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
SET[1] = (G117) with the spindle length in the Y direction type 0 (in mm) if G117 mono-rotating,
with rotation centres distance in the Y direction type 0 (in mm) if G117 bi-rotary
SET[2] = (G117) with the spindle length in the Z direction type 0 (in mm) if G117 mono-rotating,
with rotation centres distance in the Z direction type 0 (in mm) if G117 bi-rotary
SET[3] = (G117) with the spindle length in the X direction type 1 (in mm) if G117 mono-rotating,
with rotation centres distance in the X direction type 1 (in mm) if G117 bi-rotary
SET[4] = (G117) with the spindle length in the Y direction type 1 (in mm) if G117 mono-rotating,
with rotation centres distance in the Y direction type 1 (in mm) if G117 bi-rotary
SET[5] = (G117) with the spindle length in the Z direction type 1 (in mm) if G117 mono-rotating,
with rotation centres distance in the Z direction type 1 (in mm) if G117 bi-rotary
SET[6] = (G117) with the spindle length in the X direction type 0 (in mm) (only valid for G117 bi-
rotary)
SET[7] = (G117) with the spindle length in the Y direction type 0 (in mm) (only valid for G117 bi-
rotary)
SET[8] = (G117) with the spindle length in the Z direction type 0 (in mm) (only valid for G117 bi-
rotary)
SET[9] = (G117) with the spindle length in the X direction type 1 (in mm) (only valid for G117 bi-
rotary)
SET[10] = (G117) with the spindle length in the Y direction type 1 (in mm) (only valid for G117 bi-
rotary)
SET[11] = (G117) with the spindle length in the Z direction type 1 (in mm) (only valid for G117 bi-
rotary)
SET[12] = (G117) with the direction cosine of the angle between dragging axis and X axis (only
valid for G117 bi-rotary)
SET[13] = (G117) with the direction cosine of the angle between dragging axis and Y axis (only
valid for G117 bi-rotary)
SET[14] = (G117) with the direction cosine of the angle between dragging axis and Z axis (only
valid for G117 bi-rotary)
SET[15] = (G117) with the direction cosine of the angle between dragged axis and X axis
SET[16] = (G117) with the direction cosine of the angle between dragged axis and Y axis
SET[17] = (G117) with the direction cosine of the angle between dragged axis and Z axis
SET[18] = (G118) with the rotation centres distance in the X direction (in mm) (only valid for
G118 bi-rotary)
SET[19] = (G118) with the rotation centres distance in the Y direction (in mm) (only valid for
G118 bi-rotary)
SET[20] = (G118) with the rotation centres distance in the Z direction (in mm) (only valid for
G118 bi-rotary)
SET[21] = (G118) with the direction cosine of the angle between dragging axis and X axis (only
valid for G118 bi-rotary)
SET[22] = (G118) with the direction cosine of the angle between dragging axis and Y axis (only
valid for G118 bi-rotary)
SET[23] = (G118) with the direction cosine of the angle between dragging axis and Z axis (only
valid for G118 bi-rotary)
SET[24] = (G118) with the direction cosine of the angle between dragged axis and X axis
SET[25] = (G118) with the direction cosine of the angle between dragged axis and Y axis
SET[26] = (G118) with the direction cosine of the angle between dragged axis and Z axis
150
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
SET[27] = (G118) with the X axis coordinate of the table rotation centre in mm
SET[28] = (G118) with the Y axis coordinate of the table rotation centre in mm
SET[29] = (G118) with the Z axis coordinate of the table rotation centre in mm
SET[30] = (G118) type G118 (mono-rotating or bi-rotary)
SET[31] = (G118) dragged axis logical number
SET[32] = (G118) dragged axis direction (counts/turn)
SET[33] = (G118) dragging axis logical number
SET[34] = (G118) dragging axis direction (counts/turn)
With the SET[0]SET[34] parameters, a G117/G118 (RTCP) set of readable settings, which can
be written by system subprograms and temporary subprograms executing G8xx e G9xx, can be
accessed. With these parameters, all settings concerning G118 and a part of those concerning
G117 can be changed, as you can do via the machine TARAT settings program.
SET parameters [...] overwrite the settings set by the TARAT program.
Through these parameters, an indefinite number of G118 settings sets are available depending
on the user's needs.
In a part-program, before programming G118, G118 settings must be written using SET[.]
parameters: when activating G118, the currently valid settings (the last programmed) shall be used,
and any setting variations through SET[.] parameters programmed after activating G118 will have
no effect until the subsequent G118 reactivation.
ATTENTION: SET[32] and SET[34] are two settings that in the TARAT program are called G118
"dragging axis counts/turn" and "dragged axis counts/turn", but the only information that CNZ32
uses for this data is the sign, which determines the corresponding positive or negative rotational
axis, or the 0 value indicating that G118 is not defined during setup and causing a CN5414 error if
G118 is programmed.
For this reason, these settings are called "directions" as an alternative to "counts/turn", and
behave as follows:
- in reading mode:
SET[32] and SET[34] make:
-1 = (negative direction) if the read value is negative
1 = (positive direction) if the read value is positive
0 = if the value is zero
- in writing mode:
SET[32] and SET[34] write:
-1 = (negative direction) if the passed value to be written is negative
1 = (positive direction) if the passed value to be written is positive
0 = If the passed value to be written is zero
N.B. "Positive direction" indicates that the rotational axis position and the corresponding angle
used for the G118 corrections calculation have the same signs. "Negative direction" indicates that
the rotational axis position and the corresponding angle used for the G118 corrections calculation
have opposite signs.
The SET[35]SET[60] parameters are used to vary the end of travel settings for 13 continuous
axes.
In detail, the individual parameters have the following meaning:
SET[35] = positive end of travel, axis with logical number 0, in mm or degrees
D. ELECTRON 151
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
152
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
D. ELECTRON 153
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
CS cosine
AT arc tangent
round opening and closing brackets
For example:
X<100-R>
This means that X parameter takes the value of 100 minus the tool radius value (unknown at the
time of programming) and X axis must move according to the result of this expression.
The same parameter to which the result will be given can be called in the expression. During the
expression the value of the parameter is that previous to the calculation of the expression.
E.g.:
X<X*X> to raise X to square
X<X-10> to subtract 10 from X
X<PAR[1]+PAR[0]> to add two PAR parameters
X<X+PAR[[PAR[0]]> to add PAR with PAR[0] index to X
For example the following syntax is valid (but we advice not to over-complicate!):
HX<12*HA/PAR[HA+PAR[HB+1]]>
Multiplication and division operations have priority over addition and subtraction operations.
e.g.:
3+4*2 = 3+8 = 11
4*2+3 = 8+3 = 11
4*2+2*7*3 = 8+42 = 50
Brackets can be used to force a priority in the execution of operations. E.g.:
(3+4)*2 = 7*2 = 14
4*(2+3) = 4*5 = 20
4*(2+2*7)*3 = 4*(2+14)*3 = 4*16*3 = 192
10 levels of brackets are available. The following expression has 2 levels of brackets:
3+(2+3)*5-4/(5-3))*2 = 3+(5*5-4/2)*2 = 3+(25-2)*2 = 3+23*2 = 3+46 = 49
Brackets must first be opened and then closed, and all closed within the expression. The
following expressions are wrong:
3+(2 * 3 a closing bracket is missing
(3+2)*3) too many closing brackets
3)+(2 bracket closed first and then opened
It is allowed to begin an expression or a bracket level with + or -. e.g.:
-3*(-2*4+3) = -3*(-8+3) = -3*(-5) = +15
RQ (square root), SN (sine), CS (cosine) and AT (arc-tang) are applied to the value, to the
parameter, or to the result of the brackets that immediately follows.
E.g.:
RQ16*2=4*2=8
RQ(X*X+Y*Y)=RQ(16+9)=RQ25=5 (for X=4, Y=3)
Values pertaining to SN, CS and AT operations are expressed in degrees and decimal fractions
of degrees.
E.g.:
SN30 = 0,5
AT1 = 45
154
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
Numerical calculations are done in a floating point with about 9 significant figures and a 10
exponent ranging from -16000 (a number with 16,000 zeroes after the decimal point) to +16,000 (a
number with 16,000 digits before the decimal point).
To simplify calculations and to avoid machine stops, the exceptions are brought back to
permissible operations.
In particular:
1. the result of the division of a number by zero will be the maximum (number with
16,000 figures), which represents infinity. The sign is the right one.
2. the result of dividing zero by zero will be zero.
3. if the result of an operation exceeds the maximum (overflow), the result will be taken
back to the maximum (16000 figures).
4. if the result of an operation is less than the minimum (underflow, 16000 zeroes after
comma), the result will be forced to zero.
5. the square root of a negative number is the square root of its absolute value.
6. the sine and cosine of a large number (more than about 6 figures) are forced to zero
and 1 respectively.
D. ELECTRON 155
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
156
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
D. ELECTRON 157
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
158
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
M3
--ELSE
M5
--END IF
Reverts the rotation direction, but doesnt start the spindle if it was still.
D. ELECTRON 159
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
In this example, the program waits until the speed is lower than 0.1 degrees in 50 milliseconds
(corresponding to 120 rpm), then waits another 0.5 seconds before issuing the request to read the
spindle position.
This is a common example, but if the spindle has very slow ramps, it may be necessary to
increase the waiting times in order to have a better precision.
160
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
The function RST(11) gives the actual machine setup status (11 = inches; 0 = mm) without
considering the G70/G71 forcing.
This function allows the programmer to design fixed cycles or subprograms using geometrical
values dependent from the setup, but not from the G70/G71 status, for example, tool radius R and
L (LX/LZ for lathes) tool length.
D. ELECTRON 161
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
RST(42) RST(44) XYZ dimensions difference between origins rotated and non-rotated by G118
The RST(42), RST(43) and RST(44) functions return the value of the difference in mm, for the
three axes XYZ when activating G118, between the dimensions of the non-rotated active origin and
those of the rotated active origin, according to the dimensions of G118 rotational axes.
162
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
The RST(55) function returns the degrees/turn of the G118 rotational dragging axis (usually
360).
The columns of this matrix identify the components of the coordinate axes unit vectors of the
reference system rotated by G116, expressed in the original reference system.
For example, by programming:
G116 K90 (rotates the reference system by 90 degrees around Z)
G116 J90 (rotates the new reference system, obtained by the first 90-degree rotation around Z,
around its own Y).
The obtained matrix is:
| RST(75) = a11 = 0 RST(76) = a12 = -1 RST(77) = a13 = 0 |
| |
| RST(78) = a21 = 0 RST(79) = a22 = 0 RST(80) = a23 = 1 |
| |
| RST(81) = a31 = -1 RST(82) = a32 = 0 RST(83) = a33 = 0 |
The three columns of the matrix represent the components of the coordinate axes unit vectors of
the reference system rotated, expressed in the original reference system.
In the case of the example, from the columns of the matrix, we have:
D. ELECTRON 163
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
RST(89) RST(91) linear axes origins variation as a result of G139 (concurrent axes)
These functions are reserved for system canned cycles programmers.
The functions from RST(89) to RST(91) return the values in mm set from G139 to the three
linear axes origins Such values may be used to correct the position of the table centre, RTCP table
(G118), as a result of the G139 concurrent axes, in the case where the table is moved from the
compensating axis of a pair of concurrent axes.
164
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
NOTES:
- The programming status of the parameters for G881G899 is reset by programming G880,
G800K0, G800KA0 or if a machine reset is triggered, while it is maintained between successive
programming procedures of other G881G899: that is, if G881NA3 and then G881NB2 are
programmed you will have RST(92) = 1 (NA programmed) and RST(93) = 1 (NB programmed)
- The programming status of the parameters for G901G999 is not maintained between
successive programming procedures of G901G999:, that is, if you program G901NA3 and then
G901NB2, you will have RST(122) = 0 (NA not programmed) and RST(123) = 1 (NB programmed).
The programming status of the parameters for G901G999 is reset by programming G900 or if a
machine reset is triggered.
ATTENTION: Should G9xx be invoked by another G9xx, the status of the parameters
programmed on the calling G9xx remains active. Example:
The part-program supports:
G901 NA10 I20
the macro associated with G901 calls a G902 as follows:
.......
G902 NB20 J30 K40
.......
G26
In this case, after calling G902, you will still have the programming status of the parameters
returned by RST( ), unaffected by what is programmed on line G902:
RST(122) = 1 (NA programmed on G901 line)
RST(123) = 0 (NB not programmed on G901 line)
RST(149) = 1 (I programmed on G901 line)
RST(150) = 0 (J not programmed on G901 line)
RST(151) = 0 (K not programmed on G901 line)
D. ELECTRON 165
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
166
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line
CHAPTER 4
PROCESS 0 1 2 3 4 5
PARAMETER TABLE 125 122 119 116 113 110
ORIGIN TABLE 126 123 120 117 114 111
TOOL TABLE 127 124 121 118 115 112
D. ELECTRON 167
Chapter 4 - Tools - Execution of ISO Line CNC Z32 Programming Manual
The CNC will normally execute these instructions when the tool changes, as if they were in a line
following that of tool change.
The execution of the tool description leads to the assigning of the value 100 to the L parameter
and the value of 20 the R parameter.
Length The tool description is as effective as an ISO line containing the same instructions: by
programming L in the tool description, the tool length and origin compensation will be calculated
again. The execution of the tool description line occurs on exiting (G26) the tool change
subprogram. On the final G26 of the subprogram, the description of the tool in the chuck is
executed, with the initialisation of parameters contained in the description (see chapter concerning
origins).
In the tool description, the programmer can enter other functions (F, S, M,...) to reduce
programming.
One or more tools with an identical place can be listed in the tool table: the operator can easily
manage multipurpose tools, because the different uses of the same tool will be marked by a
different T but with an identical # place. The tool description may be different in one or more
parameters, in order to exactly describe the features of the tool to be used.
There will be a limitation to the multiple definition of the same tool in case of random tool
change. Please refer to the paragraph Multipurpose Tools and Random Management.
The tool is programmed in the part-program with parameter T followed by a number consisting
of up to 9 decimal integers. Initial zeros can be omitted (but it is not necessary to omit them).
Remember that initial zeros of the number after T must be omitted in the tool table.
E.g.:
T1234 indicates that tool no. 1234 is programmed
When programming T, stop is requested. Please refer to chapter Preparatory G Functions,
paragraph G Functions.
By programming T, the operator asks the CNC to communicate to the PLC the future tool, but
this will not immediately trigger the tool change, which will be performed by entering M6 instruction
in the same line or in following lines.
After power on and after a part-program start, the description of the tool mounted on the spindle
is analyzed and the parameters contained in that description are consequently initialized.
Tools do not need to be edited in an increasing T sequence, but it is useful to allow a better
consultation.
E.g.:
:TL
T471#32 L100 R20(MILL D40 HSS)
T472#32 L50 R30 (physically no. 471, with different correctors)
T371#16
T12#27(DRILL D10 HSS) L80 R5 S1000 F200
...
For correct system functioning, Z32 must always know which tool is placed on the spindle, even
when passing from one program to another, and after shutting off. As the tool placed on the spindle
can be from a global section or local sections, Z32 must know:
the number of the T tool
the number of the file that contains the section the tool comes from.
This information is memorized by Z32 in the first line of the global file no. 127. E.g.: if the first
line of table contains:
T12P3 the T12 tool, coming from program no. 3, is placed on the spindle.
168
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line
If the P instruction is not included, the tool will be considered as coming from global table.
The first line of the table is automatically up-dated by the CNC, every time a tool change
operation is performed: the operator can modify that line in case of manual operations.
When the operator writes a brand new tool table, he needs to insert this first line, every time,
even if the spindle is empty (ask the manufacturer for the tool number usually assigned to null tool-
usually T0 or T1).
If tool table is missing, the CNC will display the alarm message:
CN1D14 PROGRAM ERROR
If the identification of the tool on the spindle (first line of table) is missing or incorrect, or the tools
section from which the tool on the spindle comes is missing, the CNC will display the alarm
message:
CN2F14 TOOL
If, instead, the file from which the tool on the spindle should come from does not exist (e.g. the
first line of file no. 127 is T10P40 and file no. 40 does not exist), the CNC will display the alarm
message:
CN0914 CMOS ERROR (non-existent file).
The syntax of the initial line of file 127, which defines the active tool, only accepts the following
structures:
Tnn blanks 0DH
TnnPnn blanks 0DH
TnnPnnJnn blanks 0DH
Other structures will provoke a tool error.
For the meaning of the J parameter, see the section Management of tool families.
After the first line and before :TL, the programmer can insert any description, which Z32 will
ignore.
REMARK
This example has to be considered as only didactic: the final user shall
follow instructions given by the manufacturer of the machine tool.
M6 SUB-PROGRAM RANDOM MANAGEMENT%
... initial presetting instructions
D. ELECTRON 169
Chapter 4 - Tools - Execution of ISO Line CNC Z32 Programming Manual
170
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line
D. ELECTRON 171
Chapter 4 - Tools - Execution of ISO Line CNC Z32 Programming Manual
The entity of the wear is decided by the operator in accordance with the machining performed.
For example, if machining can be repeated 120 times before replacing the tool, the operator
must enter a wear value = 8.34 (=1000/120). The same tool can be used for various machinings,
each of which influence the tool life proportionally.
US parameter is up-dated inside the special M6 sub-program, through HU parameter sent by the
main program.
When a tool is completely worn out, it can be replaced by another in tool magazine: the worn out
tool description includes the TS parameter which identifies the replacement tool. Several
replacement tools can be put on chain. The last of the chain has TS = 0. When the last tool of the
chain is completely worn out, the CNC will show an alarm message:
TOOL TABLE
...
T10#...R..L..TS11 US1000 (it can be replaced by T11)
T11#...R..L..TS12US905 (partially worn out-to be replaced by T12)
T12#...R..L..TS0 US1000 (last of the T10 chain)
...
T20#...R..L..TS0 US1000 (it has no replacement)
...
PART-PROGRAM
...%
N1 HU0 T10 M6 manufacture with T10 tool: after 120 changes the
tool is worn out.
N100 HU8.34 T30 M6
...
M6 SPECIAL SUB-PROGRAM
... searching for replacement tools, also in block search
procedure
N1 !:RT US=US!IF US>0;GO//N5!:RT TS=TS
N2 !IF TS<=0;NO SUBSTITUTIVE TOOL
N3 T<TS>
N4 !GON1! (it repeats, searching for a good tool)
//N5 !GON7! (in block search procedure tool wear is not up-dated)
N6 !IF HU=0;EB!:RS US=US!US=US-HU!:WS US=US!
(it up-dates previous tool wear condition)
N7... (continuing with normal change)
172
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line
T4#10L11,76R4
...
From the viewpoint of the user, the management of tool families has various aspects:
- recognition of the family member
- programming of T code and position in the family
- storing of the family number of the active tool
- search of the number of family members
- access to the family member from the part-program with :R and :W
- modification of tool parameters from task 4
- access to the member from DTO, task 4 and 5
Recognition of the family member
The number in the family coincides with the position in the tool table:
number 1 = the first
number 2 = the second ...
Programming of T code and position in the family
The programming of the position in the family is carried out through the J parameter, which must
be included in the same line where T has been programmed. For example:
T4 J2
asks for the search of the second tool of the T4 family.
In order that the J parameter be considered as a position in the family, no other parameter
should be entered in this line, except for M parameters. For example:
T4 J2 M6
search and change of the 2nd tool of the T4 family
T4 G2 X10 Y0 I5 J0
The line includes other parameters (axis measures and I), therefore in this case J does not refer
to a position in the family (in fact, the machine will execute an arc).
T4 HX0 J2
The line contains the HX system parameter, therefore J2 is not considered a position in the
family. As a result, a programming alarm will be released because J in this case is a centre
measure, which cannot be accepted when alone.
If the J parameter is not programmed, the operation is compatible with the previous versions:
the recognised tool is the first.
The position in the family can be any number from 1 to 256.
Other values will give rise to an error of incompatible parameters, except for the value -1 which
starts the search of the members of a family.
Fractions are rounded off to the integer.
If the position in the family is higher than the number of family members a tool error alarm will be
released.
Search of the number of family members
In order to avoid programming alarms, it may be useful to know the number of members in a
family beforehand. This is possible by entering -1 as the position in the family:
T4 J-1
asks for recognising how many members has the T4 family.
D. ELECTRON 173
Chapter 4 - Tools - Execution of ISO Line CNC Z32 Programming Manual
174
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line
D. ELECTRON 175
Chapter 4 - Tools - Execution of ISO Line CNC Z32 Programming Manual
176
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
CHAPTER 5
Fields are performed in the order in which they are written. The following paragraphs provide
details about the instructions that may be enclosed in an evolved line field.
D. ELECTRON 177
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
If the operator subsequently enters, in an ISO line, the instruction X<X>, the value given to X in
the evolved line is confirmed and the movement is obtained.
5.2 JUMPS
Five types of jump instructions are possible:
jump to a line without return (GON...)
jump to a series of lines with return (GON...-N...)
jump to a sub-program with return (GOP...)
jump to a line inside a subprogram (GOP-N)
jump to a series of lines inside a subprogram (GOP-N-N)
The line number or the program number can be made into parameters (see specific paragraph
further on in this chapter).
178
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
D. ELECTRON 179
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
N20: a jump to N15 is conditioned by a parameter: until the jump to N20 is performed there is no
return from lines N10-N20; when the jump is no longer performed (HA = 10), the CNC
returns to N31.
We suggest this feature be used only by experienced programmers: initially, it is advisable to
avoid jumps from the end line of a series of lines.
The previous program could be more clearly edited as follows:
N10 G0 X0
...
N20 !HA=HA+1!IFHA<10;GON15!
N21
...
N30 ! GON10-N21 !
N31 ...
By adding an empty line (N21) as end line, any misunderstanding on Z32 behaviour is avoided.
If, instead, the end line includes an implicit jump (a canned cycle or a special M function, for
example), the return from the series of line will be done after performing the service sub-program.
E.g.:
...
N9 G27C1
N10 G0 X50 Y10
...
N20 X65 Y20
...
N29 G27C4
N30 ! GON10-N20!
N31 ...
Line N20 contains an implicit jump to the canned cycle (it is c.c. 1 on the first turn and 4 on the
second turn): at the second turn, the jump to the canned cycle subprogram is regularly performed
and, at the end of the canned cycle, a return to line N31 occurs.
10 nesting The end line can also coincide with the beginning one: the CNC will perform an only line.
levels Jumps with return can be executed inside other jumps with return, up to 10 levels. Beyond this
limit, the CNC will display an alarm message: CN2E14 TOO MANY SUBROUTINES.
The CNC considers the following as jumps with return (a level of nesting is used):
- GON...-N... jump to a series of lines
- GOP... jump to sub-program
- special M
- G27C... system or users canned cycle
- G27P... permanent sub-program
The level number decreases by 1 every time there is a return from a sub-program or a series of
lines: it is normally impossible to reach the maximum allowed.
G110 (rough-machining macrofunctions) uses two levels.
The following example describes how the operator can call for series of instructions.
The purpose of this program is to dig a rectangular window, with a path of the cutter centre as
showed in the picture. The tool has to pass two times, increasing Z by 5 mm.
%
N0 G25XYZ T100 M6 already defined in T100 are F200 S1000
180
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
Please note that, during the execution of N12, the CNC meets another jump with return: this
means the program in the example has two levels of nesting.
It should be noted that the return from a series of lines is performed only if the end line does not
contain an explicit jump that has to be performed (with GO)
The EB instruction and implicit jumps to sub-programs (canned cycle, special M...), even
though performed, will not prevent the CNC from coming back from series of lines.
Example of a incorrect program:
N1!GON10-N30!
...
N10X0
N20Y10
N30!GON56!
...
Return from line N30 will never be performed, as the line will be interrupted due to a jump to
another line.
D. ELECTRON 181
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
182
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
Main Program:
...
D. ELECTRON 183
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
A very long part-program has to executed, as a result requiring the DNC mode. This program
should include the possibility of being interrupted at some certain points whenever required by the
machines PLC. The PLC provides the PAL[5]=64 parameter in the case that the program must be
interrupted.
The following line must be entered in the part-program executable in DNC mode:
184
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
...
!IF PAL[5]=64;G26!
... (DNC continues if PAL[5] other than 64)
or:
!IF PAL[5]<>64;EB!G26!
... (DNC continues if PAL[5] other than 64)
Similarly to the jumps GO... if G26 is executed, the following fields will be ignored, and the
line will not be recognised as the final line of a jump GON...-N...
The G26 field must end with an exclamation mark and must not include blanks, otherwise it
will not be recognised and a program alarm will be released.
5.3 CONDITIONING
This instruction orders Z32 to execute or not execute the following fields separated by character
; up to the first ! character, according to whether or not conditions are verified.
e.g.
!IF (expr.1)<=>(expr.2);(field A);( field B);...!( field C)!
Meaning: if the value pertaining to expression no. 1 is less, equal or greater (only one or two
conditions can be used) than the value of expression no. 2, go on performing the next field (A),
otherwise jump to the first ! character and continue with the next field (C).
Examples:
N12 !IF X >= 3;GON30!
if X is greater or equal to 3, jump to N30, otherwise go on with the next line (there are no further
fields).
N12!IFAA<>2;GON30!GON47!
if AA is different from 2, jump to N30, otherwise jump to N47.
N12!XA=XA+1!IFXA>5;XA=5!
increase XA of 1; if the result is more than 5, set XA=5
N12 !IF R=5;EB! R=R-1,5;IF R<5 ;R=5!GON1-N11!
If R=5, go on with the next line (EB), otherwise decrease R of 1,5: if the result is less than 5,
bring R back to value=5, then repeat lines from no. 1 to no. 11 with the new R. This line allows the
repetition of a succession of lines with the R parameters, decreasing of 1,5 its original value, limiting
R to a minimum of 5. After the last pass with R=5, the CNC will go on.
N12!IFX<10;IFY<10;EB!GON63!
if X is less than 10 and Y is less than 10, go on; otherwise jump to N63.
N1X10
...
N10 !R=R-1!IF R = 5;GON3!
...
N20!GON1-N10!
Repeat lines from no. 1 to no. 10. Please note that the end line has a jump, conditioned by R=5:
the return from N10 will be performed only when the cycle is terminated, that is when the jump
GON3 is not performed because it has become R<5.
D. ELECTRON 185
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
WARNING
= condition will be verified if the two results are identical up to to the last
decimals. Since the required approximations can lead to errors on last
decimals, we suggest using the <= or >= conditions in place of =.
E.g.:
...
N10 Z10
N11 ...
...
N20!Z=Z-0.1!IFZ=0;GON30!
N21 ...
N22 ! GON11 !
...
N30 ...
In N20 line the operator must use Z=0 to jump to N30, but the program does not run because
there are some approximations. Binary 0.1 (Z32 performs all calculations in binary code) is a
periodic number and therefore approximated.
The correct way to program is to include in N20 the <= condition, which can always be found.
186
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
If, in the CMOS section involved, the indicated parameter does not exist, the CNC will display an
error message: CN1D14. If, instead, the parameter does not exist in the memory of the part-
program, it will be created with zero value.
The symbol of the parameter in CMOS can be the same as, or different from, that one of the
parameter in memory (remember that the symbol of the parameter in work memory cannot include
digits).
The highest number that can be written is 999999,999 (six full numbers and three decimals); if
the number to the written is greater than the maximum the maximum number is written.
In the case of origins with digits (1-999), the origin name can be programmed with an
expression, that is, the origin number may be the result of an expression.
E.g.:
!:ROX1=HA! reads OX1 in the HA parameter
!HA=50!:WOX1=HA! makes OX1=50
!:WOX1<50>! also this expression makes OX1=50
!:ROX1=HA!HA=HA+5!:WOX1=HA! moves OX1 origin by 5mm
!:ROX1=HA!:WOX1<HA+5*X>! as above.
!:WTL<50,5>! makes L=50,5 for the programmed tool
!HX=2!:WOX<10*HX>=HA! fa OX20 = HA
!HX=4!:WOZ_3<10*HX><42+HY>! fa OZ_340 = HY + 42 (two-character axis)
D. ELECTRON 187
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
A writing operation in the permanent memory consists of various operations, which can be
interrupted by a reset or a power drop. In this case, in the involved file, the line will be split into two
parts immediately after the address of the incomplete parameter: if the operator uses that
parameter (CMOS memorized) another time, the CNC will show an alarm message (CN...). The
operator has to restore in memory the correct parameter.
WARNING
Local parameter-origin-tool sections from part-program must not be
written if several part-programs can act simultaneously on the same local
section.
188
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
reads the place of the programmed tool in HA parameter, and the place of the tool on the
spindle in HB parameter.
It is possible to modify the place of the tool using:
!:WS#=HA!
which modifies the place of the tool on the spindle.
WARNING
Local parameter-origin-tool sections from part-program must not be
written if several part-programs can act simultaneously on the same local
section.
WARNING
This operation (tool place modification) is to be performed by the
manufacturer of the machine tool in his special sub-programs.
An incorrect modification can lead to collision when changing the tool.
D. ELECTRON 189
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
!:CPH1=HA!
requests the reading of the H1 parameter from the parameter section, storing its value in the
part-program parameter HA. If the requested parameter is not found, the result parameter is not
changed.
If the read concerns the base origin, the CN1D14 error is triggered. For example:
!:COX0=HA! error CN1D14
If the destination parameter is the HX parameter (used for the operation result), the CN1D14
error is triggered. For example:
!:COX1=HX! error CN1D14
In all other cases, the value of HX after the instruction expresses the operation result with the
following coding:
- if HX=0 the requested parameter has not been found (:R should trigger the error CN1D14)
- if HX=1 the requested parameter has correctly been found and read
- if HX=2 the requested parameter is the active origin, but the base origin is active; the reading
has not been performed and the destination parameter remains unchanged. Example:
!:COX*=HA! if the base origin is active returns HX=2, HA unchanged
If the origin has been correctly programmed, but it is excluded (suspended) by a G53, the
operation result is HX=1 and the value read is that of the suspended origin.
The instruction :CT allows to read a parameter from a tool of the active tool table. This is
obtained by specifying the tool number desired with a number (like T3) or an expression (like
T<HA+1>).
HA19
!:CT<HA+1>US=HB!
reads the value of the parameter US for the tool T20 from the active tool table, storing its value
in the working parameter HB.
:S instruction (similar to :W)
It has the same syntax as the :W instruction, but can only be applied to the programmed tool
(:ST), the tool on the spindle (:SS), and an origin in the active origins section (:SO).
In the case of origins with digits (1-999), the origin name can be programmed with an
expression, that is, the origin number may be the result of an expression.
Examples:
!:STCU=HA!
requests to write in the CU parameter of the programmed tool the value contained in the part-
program parameter HA.
!:SSDDL=0!
requests writing the 0-value DDL parameter in the tool description on the spindle
In the case of origins:
G37OL (activates the origins local section, for example of file 30)
!:SOX1<123.67>! (writes in the local section of file 30 OX1=123.67)
190
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
5.5 OTHER
D. ELECTRON 191
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
HA20
!:L<HA+1>-\Z32\PPG\FPROV.PRG!
The FPROV.PRG file that is stored in the \Z32\PPG directory is loaded in file n. 21.
If the result of this expression is a fraction, it is rounded off to the nearest integer.
For example:
HA13
!:L<HA/3+30>-\Z32\PPG\FPROV.PRG!
The FPROV.PRG file that is stored in the \Z32\PPG directory is loaded in file n. 34.
The file to be installed cannot be the current program or subroutine, nor a program or subroutine to
which a return is to occur.
For example, if we are in subroutine 10, that was called by subroutine 5, that was called by the
main program 1, programs 1, 5 and 10 cannot be loaded.
On the contrary, subroutine 10 can be loaded (it is the purpose of :L) while program 1 is being
executed, then n. 10 executed as a subroutine.
For example, the following sequence, inserted in the main program 1 is accepted:
!:L 10 -C:\PPG\OP3244.1!GOP10!
!:L 11 -C:\PPG\OP3244.2!GOP11!
!:L 10 -C:\PPG\OP3244.3!GOP10!
!:L 11 -C:\PPG\OP3244.4!GOP11!
this sequence can be useful to load from disk a long program subdivided into 4 parts.
All the printable characters between - and the field delimiter (; or !) including any blanks are
considered as the complete name of the file stored on the disk.
The filename cannot contain:
the $ character that ties the line to the next one
the ; and ! end delimiters
characters whose code is lower than 20 hex or higher than 7f hex that would prompt a
CN1D14 PROGRAM ERROR
No syntax check is made on the filename but only a few formal ones: it must be correctly delimited at
the end (no ends of line are acceptable without delimiter) and must have a number of characters
ranging between 1 and 80 inclusive.
The file saved on the PC must be a normal ASCII file (editable by any word-processor generating files
without text formatting characters), with a length not exceeding 64 K.
The supporting DOS program performs the necessary conversions from PC ASCII into Z32
format.
The loading method used by the supporting DOS program is particularly fast (some dozens of kb
per second can be written), but the file loaded into the Z32 is not permanent, that is, it disappears
from memory once the PC has been switched off. On the other hand, since the file is permanently
stored on disk, this should not represent a great problem.
WARNING
A file loaded using :L can be edited (using option 5), but the results will
stay valid as long as the NC is powered; results are not guaranteed when
the PC is switched off and then on again, the file will be null.
The following error messages have been added for :L:
CN4E14 :L DISK FILE ERROR
Informs that the DOS program found a reading error while accessing the selected file.
192
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
There is no other detail on the error that may be due to number of reasons: file or directory not
found, disk not ready, error during access to disk, and others. It is up to the operator to correct this
error.
CN4F14 :L Z32 FILE ERROR
Informs that Z32 found an error while writing the file. Here too there are no further details.
The error may be due to a number of causes: memory full, file used by the Z32, writing error,
etc. In this case too, the operator must correct the error.
CN5014 UNKNOWN :L ERROR
Informs that an error occurred during the dialog between Z32 and the supporting program.
If the DOS program is correct, this type of error should never occur.
D. ELECTRON 193
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
G112 is the special synchronization G, but any other function with stop can be used (M, G4,
etc.). This trick will always work but requires that the program be split at a suitable point accepting a
stop.
194
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
N6 !:L254-P4523.PRG!
N7 QR<QR+30>
N8 !IF QR<360;GON2!
N9 Z30
N10 M2
The lines from N2 to N8 are repeated 6 times, in 6 different angles distant 30 degrees from each
other.
Here are some specifications on the part-program file to be executed in DNC:
% character not allowed
it must not carry the % character at the beginning (this means that any initial comment must be
delimited by round brackets as specified by ISO standard)
For compatibility with a not documented feature of NTERM and ZTERM interfaces, an exception
is made for a single % character only at the end of the first line (but it is better to avoid the usage of
% character inside DNC programs).
Concatenation of part-program lines with the "$" character not allowed
The concatenation of multiple lines with the "$" character is not allowed in part-programs
executed in DNC.
termination with G26
It must end with instruction G26 (return from subroutine)
GON and GON-N jumps
The jumps executed with the instructions GON or GON-N are allowed also in DNC and for any
distance from the starting line, toward any point of the part-program in execution.
This feature is allowed only if the program supplying the DNC file runs under Windows (Windnc
version 4.3.0 of 15.1.07 or later); it is not allowed with older Windnc versions or on DOS
installations with TERMS or ZTERM interfaces.
The research for the destination line starts from the beginning of the part-program and stops at
the first line initiating with the string indicated by GON or GON-N.
If the Windnc program doesnt find the requested line (both on jump destination or return
destination), the alarm CN8614 DNC JUMP OR RETURN ERROR is issued.
Program upload/download with the :L function
During a DNC execution (with the evolved function :L254-) it is possible to use inside it other
upload/download functions :L nested inside the original :L254 function starting the DNC
transmission.
This feature is allowed only if the program supplying the DNC file runs under Windows and the
DNC part-program is handled by the D.Electron program Windnc (Windnc version 4.5.4 of
22.10.08 or later); it is not allowed with older Windnc versions or on DOS installations with TERMS
or ZTERM interfaces. This feature is supported starting from Z32 for Windows version V12.1 of
12/1/09.
D. ELECTRON 195
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
Let us suppose that in the directory C:\Z32\PPG we have 500 different part-programs to choose
according to a certain parameter (e.g. HA) which varies from 1 to 500.
To use the programmable name, a number from 1 to 500 must be entered in the file name, for
example:
PPG1
PPG2
PPG499
PPG500
At this point, if HA contains a number from 1 to 500, it will be sufficient to write:
!:L254-PPG<HA>!
It is also possible to introduce an expression, provided that it is written between pointed
brackets:
!:L254-PPG<HA+1-HC*2>!
The expression can be included in the file name, or can be repeated several times:
!:L254-PPG<HA>.DAT!
specifies the file names PPG1.DAT, PPG2.DAT etc.
!:L254-PPG<HA>.<HB>!
specifies the file names PPG1.1 (HA=HB=1), PPG20.46 (HA=20, HB=46) etc.
Here follows some rules for the expression:
- the initial 0s are always left out; if the expression is zero, only one 0 must be entered
- if the result of the expression is negative, the program will assume it as absolute value
- if the result of the expression is a fraction, the program will assume its nearest integer.
196
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
The two strings "START" and "END" are also accepted for specifying the file start and end. For
example:
!:L254-PRG126.ISO[312--82468]
!:L254-PRG126.ISO[START--4743]
!:L254-PRG126.ISO[2810--END]
The NC alarm codes linked to this function (communicated to Z32 by the special Windows
application) are:
CN6514 :L WITH [ ]: SYNTAX ERROR
CN6614 :L WITH [ ]: POINTERS NOT IN LINE HEAD POSITION
CN6714 :L WITH [ ]: POINTERS BEYOND END OF FILE
CN6814 :L WITH [ ]: START POINTER HIGHER THAN END POINTER
Evolved instruction :P
With the following syntaxes it is possible to use an evolved line field to display part-program data
on the screen:
!:P n1 - n2 string [expression] ...!
:P is the opening of the special field (P for Print)
/. to format data with a point instead of a comma (optional)
n1 is the position of the initial character (min. 0, max. 158)
- is the hyphen (minus sign) separating n1 and n2
n2 is the position of the last character (min. n1+1, max 159)
string is an ASCII string delimited by double quotes (optional).
[expression] is an algebraic expression delimited by square brackets (optional)
! is the field opening and closing character (; is also valid except at the beginning of a line)
- :Pn1-n2 are mandatory.
- n1 and n2 identify the characters of the special display screen strings (two full lines, therefore a
maximum of 160 characters are available)
- The characters between n1 and n2 (inclusive) are cancelled and replaced with the data to be
displayed.
- Strings and expressions are optional, and can be repeated many times in any sequence, until
they fill the number of characters set (n1-n2).
- Nothing is ever written outside the field delimited by n1-n2. If the printing is longer, it is cut off
without prompting any alarm.
- The strings can contain all the printable characters except for double quotes that are used as
delimiters.
- Expressions can be all those that can be included in the subroutine.
- The results of the expressions are printed without leading zeros and with a maximum of 3
decimals. The highest result that can be displayed is 999999,999. Higher results are saturated to
the maximum without prompting any N/C alarm.
- It is possible to specify the formatting of values (expression results) with a decimal point
instead of a comma, by programming /.
D. ELECTRON 197
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
- There are no blank spaces either before or after the results of the expressions. Add if
necessary. If n1 and n2 are not consistent, or delimiter characters do not exist, etc, a CN1D14
PROGRAM ERROR alarm is prompted.
- After requesting a display using :P the displays from PLC are frozen (even in the area outside
n1-n2).
- To cancel the displayed data and resume other displays of PLC data, an evolved line field must
be programmed in the subroutine in the following form:
!:P /R!
Examples:
!:P0-30 HA=[HA] HB=[HB]!
Displays the two parameters HA and HB, with a description.
!IF HA<0;:P0-60 WRONG VALUE OF HA = [HA]!
Displays only if HA<0
!:P20-80"Result: [12*4-PAR[18]+CS(HB-30)]!
Displays the result of the expression
198
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
The string immediately follows the required file, the expression is calculated and immediately
follows the required file.
Example:
HA 45
!:F12"Value at point 4: "[HA*2]!
In file # 12, the following string is entered:
Value at point 4: 90
HA100,123
!:F/.40"PARAM. HA="[HA]!
The following line will be inserted in file 40: PARAM. HA=100.123
The field can include several strings and expressions up to 160 characters. Eventual characters
in excess will be ignored.
Any file number from 1 to 99 is accepted, yet the file specified cannot be the same file that is
currently running in automatic execution.
The evoluted line instruction :F allows to write ASCII strings in a CMOS file from a prt-program.
The main purpose of this instruction is to allow the compilation of production reports.
If the dimension of the CMOS file overcomes 64kB due to a :F instruction, old values at file
beginning are automatically deleted to obtain space for the new ones.
Warning: it is good practice to avoid a file overcoming the 64kB limit, because the deletion of
initial bytes may be quite long (also more than 1 second), thus slowing down the part-program
execution.
A specific syntax can be used to delete the file completely:
!:F nfile/R!
Example:
!:F90/R!
Deletes file # 90.
D. ELECTRON 199
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
200
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
If the DNC mode has been chosen at the execution start, the currently running file is the # 254.
In block search mode the effects are:
- the destination file is opened and read
- the fixed section of the initial string is checked
- the number of the current program is checked to verify whether it coincides with the number in
the block search
- the length of the initial string is checked; date and time are not important, but the line must
contain 34 characters
If the check result is positive, the block search continues normally, and the operators choices
will be read by the DOC file. On the contrary, in case of errors, the block search will continue in a
special mode: as the DOC file data are inconsistent, the operator will be prompted to repeat his
choices at every optional block.
Optional block
During the program execution the optional block is executed or not executed according to the
status of the external selector.
If the DOC file is enabled (i.e. the !DOC>...! field has been previously enabled in the program),
the operators choice is stored in the DOC file in a line consisting of the only character 0 when the
line is not executed, and 1 if the line is executed.
In the block search mode, we have one of the following cases:
- if the DOC file is not enabled, the line is executed or not executed according to the selectors
status. The function is the same as in the previous versions.
- if the DOC file is enabled and contains no errors, the DOC file will be opened and the
operators choices repeated. The current status of the optional block selector does not have any
influence. If errors are found during the DOC file reading, the working mode is switched to the DOC
file mode with errors. (See the following notes.)
- if the DOC file is enabled (i.e. the program contains the !DOC>...! instruction), but in the error
mode, a STOP command is released (as with M0) in order to allow the operator to repeat his
choice. The check of the optional block selector status - and therefore the choice to execute or not
execute the line - is made by pushing the START key to continue the search.
Program sectioning
The program sectioning option, enabled by a line with an initial : character followed by the
section number, allows a much quicker block search. However, the optional blocks in the skipped
sections cannot be recognised or decoded.
In order to allow the synchronization of the pointer read mode with the section start, the program
sectioning option should be included in the DOC file.
In the execution mode, the sectioning line generates, in the DOC file, a line consisting in the :
character plus five digits that identify the section. Eventual initial 0s are also included.
For example, the part-program line:
:456
generates a line in the DOC file:
:00456
In the block search mode, the sectioning line requires the search of a corresponding line in the
DOC file. The operators choices reading is resumed for the lines immediately following the
sectioning line.
If the DOC file contains an error, the sectioning line will be ignored with regard to the DOC file:
however, the choices related to optional blocks will be required to the operator via a program
STOP.
D. ELECTRON 201
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
The syntax for prompting the operator (only possible from an ISO line) is the following:
paramname<IN:comment>
where paramname is the name of the parameter that the operator must enter, while comment is
the string displayed to the operator that describes the function of the required parameter.
HA<IN:CUT DEPTH>
This dialog box displays the current value of the parameter, e.g. if HA value at that point of the
program is 5.234, the dialog box will display:
202
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write
In any case, it is the same as the value introduced by Z32 into the dialog box had been entered
by the operator.
The operator can delete one or more digits and substitute them to reach the desired value.
INPUT is an instruction with stop, therefore before being carried out, it requires that all
currently open instructions be completed. In addition, like the other function with stop, it cannot be
programmed at the open points of the part-program (radius compensation, open geometry, etc.).
Once the open instructions are completed, the command line will be modified with:
where the field of 14 characters between pointed brackets contains the parameters value and
the cursor is available for data input.
The operator can modify the value displayed or simply fill the field with the new value that must
be assigned to the parameter, and then strike the Enter key. If the syntax is correct, the value will
be acquired by Z32 and the part-program execution will continue.
In entering the value, the operator can use the following special keys:
- BACKSPACE or LEFT ARROW delete the last digit, launching the editing mode: it is the
same as the other characters of the old value were entered by the operator.
- any other character will delete the value in the input box completely.
If the value is not accepted (e.g. it includes too many significant characters), a "?" will appear
prompting the operator to correct the string.
The CN6314 <IN:...> INVALID STRING alarm is linked to the input instruction.
The parameter input is enabled in both the execution and in the block search modes.
An interesting possibility is given by linking the INPUT instruction with the DOC file (enabled
through the !DOC>filenumber! instruction).
If the DOC file is not active, during the block search the INPUT instruction will be prompted
exactly in the same way as required during execution.
If the DOC file is enabled during the parameter execution, the parameter will be stored in the
DOC file in order that it will be available for an eventual block search.
In the block search mode, if the DOC file is active, the INPUT instruction is acquired into the
DOC file, but if the DOC file is corrupted or inconsistent, the operator will be prompted for the
INPUT instruction, as in the case of DOC file disabled.
D. ELECTRON 203
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
204
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 - Structured programming functions
CHAPTER 6
The structured programming instructions are evidenced by the fact that the line which contains
them begins with two consecutive "-" characters. So that they are perfectly compatible with the
existing programs, which would give an error if they did not contain this type of line.
D. ELECTRON 205
Chapter 6 - Structured programming functions CNC Z32 Programming Manual
- expression 1 and expression2 are the possible expressions in syntax Z32 (the most simple
form of expression is a number or a parameter.
= equal
<> different
2) condition = /
IF implementation depends on the barred block switch
3) condition = //
IF implementation possible only in block search mode.
- instructions are any number of lines undertaken by Z32, that is "ISO" lines, evolved lines
and other structured instructions.
- there may be any number of blanks between END and IF (ENDIF is also recognized, without
blanks)
- the ";" closing character and the following comment are optional are optional.
Example 1:
--IF HA=0 ;case 0
HB10
--ELSEIF HA=1
..HB11
--ELSEIF HA=2
HB105
--ELSEIF HA>2
HB1000
--ELSE
HB-1
--END IF
Which assigns different values to the HB parameter according to the value of parameter HA.
Example 2:
--IF / ;to be carried out as barred block.
G0 Z100
T0 M6 (UNLOAD SPINDLE)
M2 (END OF PROGRAM)
--END IF
The program run is interrupted if the barred block switch is engaged.
Note that the same function could be obtained without structured programming, by adding the
character "/" to the three instructions which make up the IF unit.
206
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 - Structured programming functions
Example 3:
--IF // ;block search in progress
HA=1 ;in block search modes it takes value 1
--ELSE
HA=-1 ;value assumed not in block search mode.
--END IF
Assigns two different values to the parameter HA, according to whether we are in block search
function or not.
It is obvious that in this case also it would be possible to obtain the same functions even without
structured programming.
END IF is compulsory, while ELSEIF is optional (which may be of any number) and the ELSE
(which normally ends the alternatives of IF).
There may be an IF "nesting" (that is, an IF inside another IF) up to 31 levels.
Example:
-- IF conditionl
instructions 1
-- IF condition2
instructions 2
-- IF condition3
instructions 3
-- IF condition4
instructions 4
-- END IF
instructions 3A
-- END IF
instructions 2A
-- END IF
instructions 1A
-- END IF
It is advisable to indent the program (that is, shift the instructions to the right, aligning them with
the IF to which they belong, as in the example) to make the instruction flow more evident and to
avoid errors in the re-closure of the IF. With END IF. Beware that in programs with many IFs inside
each other, it may be difficult to find where the END IF is missing.
A jump to a sub-program temporarily cancels the IF level, and the return from the sub-program
returns the level of IF present at the time of the jump.
The following program structure is therefore totally valid:
--IF condition1
--IF condition2
!GOP20!
--END IF
--ELSEIF condition3
istructions3
--END IF
D. ELECTRON 207
Chapter 6 - Structured programming functions CNC Z32 Programming Manual
if conditions 1 and 2 have occurred there is a jump to sub-program 20, and ELSEIF is not
carried out on return, even if condition 3 has occurred.
It is possible to insert a G26 (return from the sub-program) within an IF cycle. Return to the sub-
program however restored the level of IF of the program to which return is to be made. For example
the following is permissible in a sub-program.
--IF condition1
--IF condition2
--IF condition3
G26
--END IF
--END IF
--END IF
In this case the return from sub-program G26 occurs correctly at IF level 3 in the sub-program;
the two lo west levels of IF are discarded and the function is resumed in the program or sub-
program recalled at the correct IF level recalled by the caller.
A M2 (program end) can be undertaken at a non zero IF level. For example the following is
correct.
--IF condition1
M2
--END IF
If END IF is programmed with no IF open the following alarm will be released CN6B14 "END IF
WITHOUT IF"
In the same way if an ELSE o ELSEIF is programmed without an open IF the following alarm
condition occurs CN7314 "ELSE OR ELSEIF WITHOUT IF"
ATTENTION: if the file ends during an IF that is not executed, various difficult-to-interpret alarms
can be generated. See the --OUT structured instruction that helps understand these cases.
The simultaneous presence of structured instructions --IF and not structured jump instructions
(!GON!) is allowed, thereby ensuring very high programming flexibility. The programmer must be
careful however to avoid !GON! jumps unduly exiting or entering --IF structures. For example,
errors can be generated by the program:
!GON1!
--IF condition
N1 ...
--END IF
...
M2
Line N1 exits the IF structure in an uncontrolled way, the END IF comes when IF has not been
properly opened, and thus a programming error is generated.
The jump to a sub-program therefore cancels the structured/non structured condition; therefore
it is possible in a program with structured instructions to jump to a sub-program which contains
instructions of type !GON and vice versa.
It is also possible, to jump from a program that contains structured instructions to a sub-program
with detail of the line or series of lines. The following is therefore valid:
--IF condition
!GOP10-N35!
--END IF
208
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 - Structured programming functions
or:
--IF condition
!GOP10-N35-N70!
--END IF
D. ELECTRON 209
Chapter 6 - Structured programming functions CNC Z32 Programming Manual
G1 F1000 Z<Z-2>
X100
Y100
X0
Y0
--LOOP 2
2 repetitions after the first cycle (last time with Z-6)
G0 X0 Y0
--DO
X<X+5>
..Y<Y+5>
--LOOP IF X<20
makes a step until X20 Y20 (ends with movement fromY15 to Y20)
G0 X0 Y0
--DO
X<X+5>
--EXIT DO IF X>=20
Y<Y+5>
--LOOP
steps similar to the previous, but ending with movement from X15 to X20, with Y=15
A DO cycle consumes a sub-routine level (as the !GOP.. and !GON-N) therefore the following
alarm condition is generated CN2E14 TOO MANY SUBROUTINES if the "nesting" of the
subroutines exceeds the maximum of the 19 permitted levels.
Several DO cycles may be contained inside each other; the permitted nesting is the total one of
the subroutines.
It is possible to enter DO cycles at IF level, non zero, and it is also possible to enter IF (up to 31
levels) inside a DO cycle.
The LOOP must be at the same IF level as DO to which it refers, otherwise an error occurs as
follows CN7414 "LOOP DURING OPEN IF". For example:
--DO
--IF condition
--LOOP ;this loop is incorrect because it occurs in an open IF:
generating CN7414
--END IF
While an EXIT DO may be inside an IF level, for example:
--DO
--IF condition
--EXIT DO
--END IF
--LOOP
In this case the EXIT DO closes all the IF levels and the cycle is resumed after the LOOP
The DO instruction may also be contained in a program implemented with DNC, but in DNC
there is a limit to the length of the instructions contained inside the body of the DO:
210
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 - Structured programming functions
in DNC the body of the DO (the instructions contained between the DO and LOOP) cannot
exceed 44KB, otherwise the following alarm condition is generated CN7614 " DO - LOOP
CYCLE TOO LARGE IN DNC"
If the LOOP is programmed without an open DO the following alarm is generated CN6E14
"LOOP WITHOUT DO"
If EXIT DO is programmed without an open DO the following alarm occurs CN7214 "EXIT
WITHOUT DO".
Warning: like the IF case, the possibility to have both DO structured instructions and (!GON!)
not structured jump instructions in the same file, gives a very high programming flexibility. The
programmer must be however careful to avoid !GON! jumps exiting or entering inside --DO
structures.
D. ELECTRON 211
Chapter 6 - Structured programming functions CNC Z32 Programming Manual
It is therefore advisable to always use full expressions; or explicit numeric values, which totally
guarantee function.
ATTENTION: If the file ends without the target line being found, various difficult-to-interpret
alarms can be generated. See the instruction --OUT that helps understand these cases.
212
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 - Structured programming functions
ATTENTION: If there is no END DEFINE, writing continues until file end, and then various
difficult-to-interpret alarms can be generated. See the instruction --OUT that helps understand
these cases.
Some program sequences may present a situation where the destination of a GOTO jump is
also defined inside a DEFINE block. Line search inside a DEFINE block is inhibited in order to avoid
possible malfunctions. For example, suppose this program fragment:
--DEFINE P4
...
N1 G1 Z<Z-5>
...
G26
--END DEFINE
G0 X0 Y0 Z0
N1 ...
...
N20 !GON1!
...
The fragment contains two N1 lines, one contained inside the DEFINE and one outside. The
destination of the jump on line N20 (!GON1!) cannot be the N1 contained inside the DEFINE block;
this line is skipped because it is contained inside a DEFINE, the destination assumed is thus the
second N1 line (outside the DEFINE), considered as the correct destination.
ATTENTION: NEVER write unpaired --DEFINE or --END DEFINE lines inside a file!
To decide if a jump destination (GON..) is or not inside a DEFINE, the file is not completely
analyzed, but only lines containing --DEFINE or --END DEFINE are searched (without considering if
they can be executed or not) and the decision if the found line has to be skipped, is taken as soon
as certainty is reached.
If the file contains unpaired --DEFINE or --END DEFINE, wrong decisions may be taken.
Example:
INITIAL COMMENT: THIS FILE DOESNT CONTAIN LINES OF TYPE:
--DEFINE
PROGRAM STARTS HERE
%
...
N1 G0 X0
...
N4!GON1!
The N1 line, correct destination for the jump on line N4, is dropped because the quick analysis
sees a start DEFINE before the N1 line, therefore the line is dropped, also if the DEFINE is inserted
in the initial comment.
D. ELECTRON 213
Chapter 6 - Structured programming functions CNC Z32 Programming Manual
Should this instruction be found an alarm will occur as follows: CN1D14 "PROGRAM ERROR".
The alarm will occur whether this line needs to be carried out or whether it needs to be missed
due to IF not to be implemented or due to GOTO (even inside a DEFINE).
The purpose of this instruction is to highlight the fact that an attempt has been made to read
beyond the end of the file. If programming is correct this line is totally useless.
However if this line is not entered and there is a programming error which results in the
continuation of reading beyond the end of the file (for example: an IF with untrue condition which is
not closet by the END IF, a GOTO of one LN which is not found, a DEFINE without an END
DEFINE) the following occurs:
- in the event of implementation by an internal file, the following error occurs CN1D14
PROGRAM ERROR on a void line, as the character 04 hex of file closure is read which is not
permitted in the lines of a part-program.
- in the case of the implementation by an internal file with irregularly closed file ( character 04
hex missing) the following error occurs CMOS 5, reading beyond end of file. Note: the Z32 may be
incorrectly closed (with character 04 hex missing) if an external editor is created, and sent to Z32
with the normal means of communication.
- in the event of execution from DNC it comes to a stop waiting for further instructions.
- in none of these cases is it immediately apparent that reading is proceeding beyond the end of
a file: if the line OUT is entered, which gives a program error and shown as incorrect line, one gets
a better understanding of the problem.
- this line must be entered at the end of the file, after all the instructions which can be carried
out. The line must be entered at the end of the file, after the last instruction that can be
implemented. (normally M2 o G26). For example:
M2
-- OUT
or:
G26
-- OUT
214
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 - Structured programming functions
For example, let us image that we need to transmit orders to PLC with PAL[1] and to operate in
synch with G112. The part-program could be:
G112 (empty of instructions in progress)
PAL[1]<1+8+64+256+512> (start bits 0,3,6,8,9)
PAL[20]1 (sync)
--WAIT PAL[20]=0 (the PLC confirms it has read the bits contained in
PAL[1])
The PLC must of course work fast (2 millisecond section) to ensure maximum time saving.
D. ELECTRON 215
Chapter 6 - Structured programming functions CNC Z32 Programming Manual
No specific instruction exists for the cancellation of a subtemp, but if necessary it is possible to
overwrite a subtemp that has already been defined with a new one. It is in practice equivalent to the
cancellation of a subtemp by overwriting a subtemp with a void.
3) There is 1 MB of total space available, the individual subtemp may reach max 240 KB
The memory space available for the subtemps (inclusive of all processes) is 1MB.
A single subtemp may have a maximum length of 240KB.
Note that the subtemps are destined for use for fixed cycles or system macro, therefore under
conditions of normal use they should not be very long.
4) Caution in subtemp cancellation.
As a first piece of advice it is advisable to never overwrite or cancel the subtemsp, even if they
appear already used remember that due to the effect of the advance of the letters of the lines; as
compared to their actual implementation, there are also a certain number of lines present that have
already been read, but are awaiting processing.
As the DEFINE operation is a reading operation, if a subtemp is cancelled immediately after
reading, there is a risk of visualization problems (which may show an error) if the old file is
overwritten with another.
As the total 1 MB of space and the possibility of having 64 subtemps per process is m ore than
sufficient for the needs of normal part-programs, it is advisable to number the subtemsp from 1
onwards and to never cancel (they are however automatically cancelled on machine RESET).
In the event of any different needs, it is however advisable to cancel the oldest subtemps,
amongst those which are no longer required, to avoid the risk of the display problems mentioned
above.
5) The $ chaining character is not permitted in the subtemp files, the lines are of 240 characters.
Inside a subtemp the maximum line length is the standard Z32 length, that is, of 240 characters.
Unlike the case of the CMOS files, a subtemp line cannot be chained to another line with "$"
character.
6) New instructions for subtemps: !GOS!, G27S
After installation in the memory with instruction --DEFINE S a subtemp may be recalled,using
instructions that are the same as those used for recallng the CMOS files of Z32:
!GOS...! (similar to !GOP! for the CMOS files), for example:
!GOS2!
to jump to the subtemp as a sub-program (the subtemp end G26 provokes the return to the
calling program.
!GOS-N-N! (similar to !GOP-N-N! for CMOS) files, for example:
!GOS2-N1-N20!
To jump to a subtemp as a sub-program and undertake a series of lines (reaching of a line
provoes the return to the calling program.
G27S (similar to G27P for the CMOS files), for example:
G27S8
To activate a subtemp as a fixed cycle.
Note that instructions G27C0 and G27S0 which annul the fixed cycle are bi-valent, which means
that both annul both the fixed cycles of CMOS and the fixed cycles of subtemp. In other words to
annul either a G27S or a G27C either G27C0 or G27S0 may be used.
Within a subtemp the following instructions are permitted (with the same means as valid for the
CMOS files) !GON!, !GON-N!, !GOP!.
7) The subtemp always belong to the user, they cannot belong to the system
216
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 - Structured programming functions
Z32 has certain critical performance protection devices of the system which are permitted in the
system sub program (CMOS file from 128 upwards) but which are forbidden in the user
programs and sub-programs (all others).
The subtemps always originate from the user, which means that the protected system resources
cannot be used.
8) It is not possible to activate local sections of tools, origins or parameters from within a
subtemp
Note that the local sections are activated from a CMOS file, using G37TL instructions (tools),
G37OL (origins) and G37PL (parameters); if these instructions are used in a subtemp, an alarm is
generated CN7914 SUBTEMP ERROR.
9) Block search with string is not possible inside a subtemp
Block search with string inside a subtemp is not possible inside a subtemp, that is, there is
nothing corresponding to control P of the block search activity 3.
D. ELECTRON 217
Chapter 6 - Structured programming functions CNC Z32 Programming Manual
218
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
CHAPTER 7
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
D. ELECTRON 219
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
220
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed up to MHB position
5. Dwell for MHT seconds
6. Rapid return to MHC position
feed MHF
feed F MHC
G0
MHA
MHD
MHB
MHT
D. ELECTRON 221
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHI: depth increment before stop for chip breakage
Type of chip breakage:
MHR: retraction for chip breakage
if MHR > 0 the retraction is executed and MHT is ignored
MHT: dwell time for chip breakage
Program MHR or MHT depending on the kind of chip breakage desired.
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed up to MHB position, with chip brakage every MHI mm, through:
- retract of MHR mm (if MHS > 0) from the actual position
- dwell of MHT seconds if MHR=0 and MHT>0
5. Rapid return to MHC position
feed MHF
MHC
feed F
G0
MHA
MHR
MHI
MHB
222
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHI: depth increment before retraction for chip extraction.
This increment is reduced by 10% at every movement up to a value of 50% of starting
MHI value, then the increments are constant.
MHZ: chip extraction position
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed for MHI length
5. rapid return to chip extraction position MHZ
6. Optional dwell for MHT seconds
7. Rapid return to the MHS safety distance from the previous position
8. Feed movement for a MHI length with percentage reduction.
The depth increment is each time reduced by 10 % up to a value of 50 % of its initial value,
then the increments are constant.
9. Points 5, 6, 7, 8 are repeated until the MHB hole end position is reached.
10. Rapid return to MHC position
feed M HF
MHC
feed F
MHT
G0
MHZ
MHA
MHD
MHI
MHS
MHB
D. ELECTRON 223
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHP: tap pitch in millimeters, example MHP 1.25
MHM: kind of tapping: rigid or with compensating chuck
MHM = 0: rigid tapping
MHM = 1: tapping with compensating chuck
MHP
G0 MHC
MHA
MHB
MHT MHW
224
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Avanzamento in lavoro fino alla quota MHB
4. Dwell for MHT seconds
5. Feed return to MHA position
6. Rapid return to MHC position, if different from MHA
feed F
G0 MHC
MHA
MHB
MHT
D. ELECTRON 225
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Avanzamento in lavoro fino alla quota MHB
4. Dwell for MHT seconds
5. If MHS=0 spindle stop and optional dwell for MHW seconds
if MHS>0 spindle orientation, retract of MHS mm along the MHQ angle
6. Rapid return to MHC position
if MHS > 0 rapid return at hole center
7. Spindle rotation restore
feed F
MHC
G0
MHA
MHB
Stop
HS
M
MHG
226
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MHA: hole start position
MHB: end hole position
MHC: high return position
MHI: increment before feed stop for chip breakage
Type of chip breakage:
MHR: retraction for chip breakage
if MHR > 0 the retraction is executed and MHT is ignored
MHT: dwell time for chip breakage if MHR = 0
Program MHR or MHT depending on the kind of chip breakage desired.
MHU: chip breaking zone end position chip extraction zone starting position
MHL: depth increment before retraction for chip extraction.
This increment is each time reduced by 10% up to a value of 50% of its initial value,
then the increments are constant.
MHZ: chip extraction position
Cycle description:
1. Rapid positioning on the plane
2. Rapid movement up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed up to MHU position, with chip brakage every MHI mm, through:
- retract of MHR mm (if MHS > 0) from the actual position
- dwell of MHT seconds if MHR=0 and MHT>0
5. Feed movement for MHL length
6. Rapid return to chip extraction position MHZ
7. Optional dwell for MHW seconds
8. Rapid return to the MHS safety distance from the previous position
9. Feed movement for a MHL length with percentage reduction.
The depth increment is each time reduced by 10% up to a value of 50% of its initial
value, then the increments are constant.
10. Points 6, 7, 8, 9 are repeated until the MHB hole end position is reached.
11. Ritorno rapido alla quota MHC
D. ELECTRON 227
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
feed MHF
MHC
feed F
MHT
G0
MHA MHZ
MHD
MHI
MHU
MHL
MHS
MHB
Mandatory parameters:
MHA: hole start position
MHB: hole end position
MHC: high return position
MHU: end of first zone position
MHV: start of second zone position
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed up to MHU position, with chip brakage every MHI mm, through:
retract of MHR mm (if MHS > 0) from the actual position
dwell of MHT seconds if MHR=0 and MHT>0
5. Rapid to MHV position
6. Movement with F feed up to MHB position, with chip brakage every MHI mm, through:
retract of MHR mm (if MHS > 0) from the actual position
dwell of MHT seconds if MHR=0 and MHT>0
7. Rapid return to MHC position
228
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
feed MHF
MHC
feed F
G0
MHA
MHD
MHI
MHU
MHV
MHI
MHB
Mandatory parameters:
MHA: hole start position
MHB: end hole position
MHC: high return position
Middle zone:
MHU: end high zone start middle zone position
(MHJ): feed inside middle zone. If MHJ=0, the middle zone feed is equal to the high zone
feed
(MHG): speed inside middle zone. If MHG=0, the middle zone speed is equal to the high
zone speed
D. ELECTRON 229
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed up to MHU position, with chip brakage every MHI mm, through:
retract of MHR mm (if MHS > 0) from the actual position
dwell of MHT seconds if MHR=0 and MHT>0
5. If MHG > 0 retract of MHS mm from the MHU position, MHG activation and dwell for MHW
seconds to wait for spindle at nominal speed
6. Movement with MHJ feed up to MHV position, with optional chip brakage every MHI mm,
through:
retract of MHR mm (if MHS > 0) from the actual position
dwell of MHT seconds if MHR=0 and MHT>0
7. If MHH > 0 retract of MHS mm from the MHV position, MHH activation and dwell for MHW
seconds to wait for spindle at nominal speed
8. Movement with MHK feed up to MHB position, with optional chip brakage every MHI mm,
through:
retract of MHR mm (if MHS > 0) from the actual position
dwell of MHT seconds if MHR=0 and MHT>0
9. Rapid return to MHC position
MHD
MHI
MHU
MHI
MHV
MHI
MHB
230
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MHB: end hole position
MHC: high return position
MHD: hole diameter
MHD > 0: counterclockwise machining (G3)
MHD < 0: clockwise machining (G2)
Cycle description:
1. Rapid positioning on the plane on hole center
2. If MHK > 0, machining approach to MHA position, and spiral descent up to MHB position.
The descent is made by increasing the MHK depth at every turn.
If MHK = 0, descent in feed up to the MHB position, profile approach and contouring
machining in a single turn.
Contouring passes are executed in clockwise or counterclockwise direction with the
following criteria:
MHD > 0: counterclockwise machining (G3)
MHD < 0: clockwise machining (G2)
3. Detach from the wall and return at hole center
4. Rapid return to MHC position
MHD > 0
MHC
MHA
MHK
MHB
D. ELECTRON 231
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MHB: stud end position
MHC: high return position
MHD: stud diameter
MHD > 0: counterclockwise machining (G3)
MHD < 0: clockwise machining (G2)
Cycle description:
1. Rapid positioning on the plane on stud center
2. Positioning on approach point, at MHS distance from the stud surface
3. If MHK > 0, machining approach to MHA position, and spiral descent up to MHB position.
The descent is made by increasing the MHK depth at every turn.
If MHK = 0, descent in feed up to the MHB position, profile approach and contouring
machining in a single turn.
Contouring passes are executed in clockwise or counterclockwise direction with the
following criteria:
MHD > 0: counterclockwise machining (G3)
MHD < 0: clockwise machining (G2)
4. Detach from the wall
5. Rapid return to MHC position
6. Return on stud center
MHD > 0
MHS
MHD
MHD < 0
MHC
MHA
MHK
MHB
232
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
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
D. ELECTRON 233
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
234
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MPX, MPY: starting point coordinates
MPJ, MPK: increments on the first and second axis of the plane
MPN: number of points
MPK
MPX 0
MPJ
MPY
Mandatory parameters:
MPX, MPY: starting point coordinates
MPG: line slope angle
MPP: distance between points
MPN: number of points
D. ELECTRON 235
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
P
MP
0 MPG
MPX
MPY
Mandatory parameters:
MPX, MPY: starting point coordinates
MPA, MPB: end point coordinates
MPN: number of points
MPB
MPX 0
MPA
MPY
236
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MPX, MPY: starting point coordinates
MPJ, MPK: row increments
MPV, MPW: column increments
MPN: number of points in a row
MPM: number of points in a column
MPV
MPJ
MPK
MPW
MP M
MPY
MPN
0 MPX
Mandatory parameters:
MPX, MPY: starting point coordinates
MPP: distance between row points
MPG: row angle relative to the first axis of plane
MPQ: distance between column points
MPT: column angle relative to the first axis of plane
MPN: number of points in a row
MPM: number of points in a column
D. ELECTRON 237
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
MPT
MPP
MPQ
MP M
MPG
MPY
MPN
0 MPX
7.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
MPN: number of points in a row
MPM: number of points in a column
MPD
MP M
MPB
MPY
MPN
238
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MPX, MPY: circle center coordinates
MPC: circle radius (positive or negative value)
If MPC is positive, positioning happens counterclockwise
If MPC is negative, positioning happens clockwise
MPA: initial angle
MPN: number of points
MPL
MPA
MPY
MPC
0 MPX
D. ELECTRON 239
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MPX, MPY: circle center coordinates
MPC: circle radius (positive or negative value)
If MPC is positive, positioning happens counterclockwise
If MPC is negative, positioning happens clockwise
MPA: initial angle
MPN: number of points
MPP
MPA
MPY
MPC
0 MPX
240
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MPX, MPY: circle center coordinates
MPC: circle radius (positive or negative value)
If MPC is positive, positioning happens counterclockwise
If MPC is negative, positioning happens clockwise
MPA: initial angle
MPB: final angle
If MPA = MPB the points are spaced along the whole circumference, starting from the
initial angle.
MPN: number of points
M
PB
M PA
MPY
MPC
0 MPX
D. ELECTRON 241
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MPX, MPY: rectangle center coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPP: distance between points on the base
MPM: number of points on rectangle height
MPQ: distance between points on the height
MPP
MPQ
MPG
MPY
MP
M
N
MP
MPX
0
Mandatory parameters:
MPX, MPY: rectangle center coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPL: rectangle base
MPM: number of points on rectangle height
MPH: rectangle height
242
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
L
MP
MP
H
G
MP
MPY
MP
M
N
MP
MPX
0
Mandatory parameters:
MPX, MPY: lower left corner coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPP: distance between points on the base
MPM: number of points on rectangle height
MPQ: distance between points on the height
P
MP
MP
Q
MPG
MP
M
MPY MPN
MPX
0
D. ELECTRON 243
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
MPX, MPY: lower left corner coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPL: rectangle base
MPM: number of points on rectangle height
MPH: rectangle height
L
MP
MP
H
G
MP
MP
M
N
MPY MP
MPX
0
244
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Parameter passing:
All necessary parameters are specified by programming them on the same line containing the
activation of G802. In the program line containing a G802 activation, it is possible to program only
parameters related to fixed cycles programming.
Unlike G800 and G801, with G802 it is possible to program the positions of continuous axes, in
order to define the macro reference point (i.e. a pocket center).
For example, with reference to the cycle G802K1, it is possible to set the parameters by
programming:
G802 X10 Y10 MMA0 MMB-20 MMC10
An example of not correct programming is the following:
G802 X10 Y10 MMA0 MMB-20 MMC10 F1000
The parameter F is not directly programmable on the G802 line, so a correct writing is as
follows:
F1000
G802 X10 Y10 MMA0 MMB-20 MMC10
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
D. ELECTRON 245
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
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).
246
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Pocket geometry:
- The pocket is defined with:
- Pocket center coordinates
- Pocket diameter (MMD parameter)
- Pocket start position (MMA parameter)
- Pocket end position (MMB parameter)
- the pocket may be conical (MMN parameter)
Emptying cycle:
- The pocket is emptied starting from the center and proceding toward the exterior, with a
spiral movement.
- The machining feed on the plane corresponds to the F parameter
- The distance between passes on the plane depends on the paramater MMP, defining the
overlap between passes.
- Passes on the plane may be executed on counterclockwise or clockwise direction. If the
MMJ parameter is zero, passes are executed in counterclockwise direction (machining
concordant with the tool running in M3); if MMJ is 1, passes are executed in clockwise
direction (machining discordant with the tool running in M3).
- The MMS parameter the machining allowance:
-If the MMV parameter is equal to 1, at the end of the pocket, a further pass is executed,
removing the MMS allowance programmed. This optional pass is executed with circular
approach and retract.
Pass increment:
- The depth pass increment (MMK parameter) may be executed on pocket center in a pre-
hole, or with a ramp descent.
If MMW = 0, at the end of each pass, the tool retracts from the machined surface of a safety
distance (MME parameter), then it executes a rapid positioning to pocket center, and
executes the pass increment with MMF feed.
If MMW = 1. the pass increment is executed with a ramp descent. The parameter MMQ
specifies the maximum slope of the ramp. Depending on the pass increment and on the
maximum ramp slope MMQ, the descent is executed with a spiral movement around
pocket center with a feed equal to MMF. If MMQ is zero, the descent is executed with a
single movement.
Cylindrical and toroidal tools may be used. The parameter R defines the tool radius, while the
MMU parameter defines the insert radius in case of toroidal tools.
Mandatory parameters:
pocket center coordinates (programmed through axes positions)
MMD: pocket diameter
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MMK: pass depth
MME: safety distance
D. ELECTRON 247
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
MMP MMJ=0
AA, AB
MMJ=1
MMD
R MMC
MMS MME
MMA
MMK
MMB
MMU MMN
248
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Pocket geometry:
- The pocket is defined with:
- Pocket center coordinates
- Length of the two sides (MML and MMH parameters)
- Angle rotation on the plane (MMG parameter)
- Pocket start position (MMA parameter)
- Pocket end position (MMB parameter)
- Pocket corners may be rounded (MMR parameter)
- The pocket may be conical (MMN parameter) In case of conical pocket, the connecting
radiuses may be handled like constant or variable connections (MMX parameter).
Emptying cycle:
- The pocket is emptied starting from the center and proceding with passes parallel to the
pocket sides.
- The machining feed on the plane corresponds to the F parameter
- The distance between passes on the plane depends on the paramater MMP, defining the
overlap between passes.
- Passes on the plane may be executed on counterclockwise or clockwise direction. If the
MMJ parameter is zero, passes are executed in counterclockwise direction (machining
concordant with the tool running in M3); if MMJ is 1, passes are executed in clockwise
direction (machining discordant with the tool running in M3).
- The last pass is executed with circular approach and detach.
- The MMS parameter the machining allowance:
-If the MMV parameter is equal to 1, at the end of the pocket, a further pass is executed,
removing the MMS allowance programmed. This optional pass is executed with circular
approach and retract.
Pass increment:
- The depth pass increment (MMK parameter) may be executed on pocket center in a pre-
hole, or with a ramp descent.
If MMW = 0, at the end of each pass, the tool retracts from the machined surface of a safety
distance (MME parameter), then it executes a rapid positioning to pocket center, and
executes the pass increment with MMF feed.
If MMW = 1. the pass increment is executed with a ramp descent. The parameter MMQ
specifies the maximum slope of the ramp. Depending on the pass increment and on the
maximum ramp slope MMQ, the descent is executed with a ZIG ZAG with a feed equal to
MMF. If MMQ is zero, the descent is executed with a single movement.
Cylindrical and toroidal tools may be used. The parameter R defines the tool radius, while the
MMU parameter defines the insert radius in case of toroidal tools.
List of parameters of the roughing macro for rectangular pockets with known pocket center:
Mandatory parameters:
pocket center coordinates (programmed through axes positions)
MML: pocket base
MMH: pocket height
MMR: fillet radius
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
D. ELECTRON 249
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
MMH
MML
MMC
MMS MME
R MMA
MMK
MMB
MMU MMN
250
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
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 une 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
List of parameters of the roughing macro for rectangular pockets with known corner:
Mandatory parameters:
corner coordinates (programmed through axes positions)
MML: pocket base
MMH: pocket height
MMR: fillet radius
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth
D. ELECTRON 251
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
MMP
MMG
MMR
MMH
MML
MMC
MMS MME
R MMA
MMK
MMB
MMU MMN
252
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Pocket geometry:
- The pocket is defined with:
- Pocket center coordinates
- Pocket diameter (MMD parameter)
- Pocket start position (MMA parameter)
- Pocket end position (MMB parameter)
- The pocket may be conical (MMN parameter)
Finishing cycle:
- The MMV parameter defines the side where profile approach and detach movements are
made. If MMV=0, approaches are executed on the right side of the pocket; while with
MMV=1 approaches happens on left side.
- Th MMQ parameter defines the approach and detach radius from the wall.
- The machining feed corresponds to the F parameter
Pass increment:
-The MMK parameter defines pass depth.
- The MMW parameter handles the spiral or constant position passe milling mode.
- If MMW=0, the finishing is executed with constant position passes. On each pass, a profile
approach and detach with radius MMQ and feed MMF is executed. The pass increment is
executed in rapid.
If MMW=1, also in case of conical pockets, the machining begins with a circular approach
with radius MMQ, up to the MMA pocket start position, then continues with a spiral
movement (at each turn the depth is increased by MMK), up to the end pocket position
MMB. At this point, the profile with constant position MMB is executed, and then the detach
with MMQ radius and MMF feed. In case of spiral finishing and conical pocket, the EC
parameter defines the chordal error used to subdivide in points the spiral movement.
At the end of machining a retract up to MMC position is executed.
Cylindrical, toroidal and spherical tools may be used. The parameter R defines the tool
radius, while the MMU parameter defines the insert radius in case of toroidal tools. If
MMU=R, the tool is spherical.
Mandatory parameters:
pocket center coordinates (programmed through axes positions)
MMD: pocket diameter
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth
D. ELECTRON 253
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
MMJ=0
AA, AB
MMD MMJ=1
MMQ
R MMC
MMS MME
MMA
MMK
MMU MMB
MMN
254
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Pocket geometry:
- The pocket is defined with:
- Pocket center coordinates
- Length of the two sides (MML and MMH parameters)
- Angle rotation on the plane (MMG parameter)
- Pocket start position (MMA parameter)
- Pocket end position (MMB parameter)
- Pocket corners may be rounded (MMR parameter)
- The pocket may be conical (MMN parameter) In case of conical pocket, the connecting
radiuses may be handled like constant or variable connections (MMX parameter).
Finishing cycle:
- The MMV parameter defines the wall where profile approach and detach movements are
made. If MMV=0, approaches are executed on the right wall; while with MMV=1
approaches happens on left wall.
- Th MMQ parameter defines the approach and detach radius from the wall.
- The machining feed corresponds to the F parameter
Pass increment:
-The MMK parameter defines pass depth.
- The MMW parameter handles the spiral or constant position passes milling mode.
Spiral milling is only possible in case of cilindrical pockets (MMN=0).
- If MMW=0, the finishing is executed with constant position passes. On each pass, a profile
approach and detach with radius MMQ and feed MMF is executed. The pass increment is
executed in rapid.
If MMW=1, in case of cilindrical pockets, the machining begins with a circular approach with
radius MMQ, up to the MMA pocket start position, then continues with a spiral movement
(at each turn the depth is increased by MMK), up to the end pocket position MMB. At this
point, the profile with constant position MMB is executed, and then the detach with MMQ
radius and MMF feed.
Cylindrical, toroidal and spherical tools may be used. The parameter R defines the tool
radius, while the MMU parameter defines the insert radius in case of toroidal tools. If
MMU=R, the tool is spherical.
List of parameters of the finishing macro for rectangular pockets with known pocket center:
Mandatory parameters:
pocket center coordinates (programmed through axes positions)
MML: pocket base
MMH: pocket height
MMR: fillet radius
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth
D. ELECTRON 255
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
MMQ
MMG
MMR
AA, AB
MMH
MML
MMC
R MMS MME
MMA
MMK
MMB
MMU MMN
256
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
The machining cycle of this macro is very similar to the finishing macro where the pocket
center is known. The only difference is in the programmed coordinates: those of a pocket
corner, instead of pocket center.
In this case the AA and AB parameters represent une 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
List of parameters of the finishing macro for rectangular pockets with known corner:
Mandatory parameters:
corner coordinates (programmed through axes positions)
MML: pocket base
MMH: pocket height
MMR: fillet radius
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth
D. ELECTRON 257
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
MMQ
MMG
MMR
MMH
MML
MMC
R MMS MME
MMA
MMK
MMB
MMU MMN
258
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Eyelet geometry:
- Eyelet center coordinates
- Angle rotation of the eyelet (MMG parameter)
- Eyelet length (MML parameter)
- Eyelet width (MMD parameter)
Finishing (only if TL = 0 or TL = 2)
1. Rapid positioning on point A (or B, depending on the sign of MML)
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to the computed depth (finishing pass depth MMK) with feed equal to MMF.
4. Finishing contouring
5. Repetition of steps 3, 4 until the eyelet end position MMB is reached. If a very high pass
depth is programmed (greater that the eyelet depth), a single pass is executed to the
MMB position.
D. ELECTRON 259
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
eyelet center coordinates (programmed through axes positions)
MML: eyelet length
MMD: eyelet width
MMA: eyelet start position
MMB: eyelet end position
MMC: high retraction position
MME: safety distance
Type of machining management:
MMV: machining type
MMV = 0: roughing and finishing with the same tool
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth
MMG
B A
MMD
AA, AB
MML
MMC
MMS MME
MMA
MMK, MMH
MMB
260
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Eyelet geometry:
- Eyelet center coordinates
- Angle rotation of the eyelet (MMG parameter)
- Eyelet length in degrees (MML parameter)
- Eyelet width (MMD parameter)
- Eyelet radius (MMR parameter)
Finishing:
1. Rapid positioning on point A (or B, depending on the sign of MML)
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to the computed depth (finishing pass depth MMK) with feed equal to MMF.
4. Finishing contouring
5. Repetition of steps 3, 4 until the eyelet end position MMB is reached. If a very high pass
depth is programmed (greater that the eyelet depth), a single pass is executed to the
MMB position.
D. ELECTRON 261
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
eyelet center coordinates (programmed through axes positions)
MML: eyelet length
MMD: eyelet width
MMR: eyelet curvature radius
MMA: eyelet start position
MMB: eyelet end position
MMC: high retraction position
MME: safety distance
Type of machining management:
MMV: machining type
MMV = 0: roughing and finishing with the same tool
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth
MMR A
MMC
MMS MME
MMA
AA, AB MMG
MMK
MMH
MMB
MMD
MML
262
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Eyelet geometry:
- Curvature center cordinates
- Angle rotation of the eyelet (MMG parameter)
- Eyelet length in degrees (MML parameter)
- Eyelet width (MMD parameter)
- Eyelet radius (MMR parameter)
Finishing:
1. Rapid positioning on point A (or B, depending on the sign of MML)
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to the computed depth (finishing pass depth MMK) with feed equal to MMF.
4. Finishing contouring
Repetition of steps 3, 4 until the eyelet end position MMB is reached. If a very high pass
depth is programmed (greater that the eyelet depth), a single pass is executed to the
MMB position.
D. ELECTRON 263
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Mandatory parameters:
curvature center coordinates (programmed through axes positions)
MML: eyelet length
MMD: eyelet width
MMR: eyelet curvature radius
MMA: eyelet start position
MMB: eyelet end position
MMC: high retraction position
MME: safety distance
Type of machining management:
MMV: machining type
MMV = 0: roughing and finishing with the same tool
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth
A
MMR
MML
AA, AB MMG
MMC MMD
MMS MME
MMA
MMK
B
MMH
MMB
264
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
7.3.10 G802K10: HOLE THREAD MILLING WITH A SINGLE FLUTE END MILL
The program executes the threading of a hole with a single flute end mill.
The thread may be right or left, depending on the value of MMJ: right thread if MMJ=0, or left if
MMJ=1.
The machining may be concordant (from low to high) or discordant (from high to low), depending
on the values of MMA and MMB.
MMA represents the start thread position
MMB represents the thread end position
If MMA is lower than MMB, the machining is executed from low to high.
If MMA is higher than MMB, the machining is executed from high to low.
The cycle is designed to guard the lower Z position inside the workpiece (MMA or MMB). The
highest Z position may be greater than the value programmed, with the purpose to execute an
integer number of threads, plus a half thread (a quarter for entry and a quarter for exit).
Mandatory parameters:
hole center coordinates (programmed through axes positions)
MMD: bottom of thread diameter
MMQ: hole diameter
MMA: start machining position
MMB: machining end position
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The roughing machining ends on thread bottom
(MMD). On this diameter are executed the MMN polishing passes.
MMQ
MMB
D. ELECTRON 265
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
The program executes the threading of a hole with a comb end mill.
The thread may be right or left, depending on the value of MMJ: right thread if MMJ=0, or left if
MMJ=1.
The machining may be concordant (from low to high) or discordant (from high to low), depending
on the values of MMA and MMB.
MMA represents the start thread position
MMB represents the thread end position
If MMA is lower than MMB, the machining is executed from low to high.
If MMA is higher than MMB, the machining is executed from high to low.
The cycle is designed to guard the lower Z position inside the workpiece (MMA or MMB). The
highest Z position may be greater than the value programmed, with the purpose to execute an
integer number of threads, plus a half thread (a quarter for entry and a quarter for exit).
Mandatory parameters:
hole center coordinates (programmed through axes positions)
MMD: bottom of thread diameter
MMQ: hole diameter
MMA: start machining position
MMB: machining end position
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The roughing machining ends on thread bottom
(MMD). On this diameter are executed the MMN polishing passes.
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. MMD
MMA
Optional parameters for thread direction:
(MMJ): thread direction
MMJ = 0 : right thread MMP
MMJ = 1 : left thread
MMQ
MMB MMH
266
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
7.3.12 G802K12: STUD THREAD MILLING WITH A SINGLE FLUTE END MILL
The program executes the threading of a stud with a single flute end mill.
The thread may be right or left, depending on the value of MMJ: right thread if MMJ=0, or left if
MMJ=1.
The machining may be concordant (from low to high) or discordant (from high to low), depending
on the values of MMA and MMB.
MMA represents the start thread position
MMB represents the thread end position
If MMA is lower than MMB, the machining is executed from low to high.
If MMA is higher than MMB, the machining is executed from high to low.
The cycle is designed to guard the lower Z position inside the workpiece (MMA or MMB). The
highest Z position may be greater than the value programmed, with the purpose to execute an
integer number of threads, plus a half thread (a quarter for entry and a quarter for exit).
Mandatory parameters:
stud center coordinates (programmed through axes positions)
MMD: external diameter
MMQ: bottom of thread diameter
MMA: start machining position
MMB: machining end position
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The roughing machining ends on thread bottom
(MMD). On this diameter are executed the MMN polishing passes.
MMQ
MMB
D. ELECTRON 267
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
MMQ
MMB
268
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
The program executes the face milling of a rectangular area defined through two opposite points
(vertices). The area to be milled is corrected with the tool radius dimensions.
The milling is executed with a zig-zag movement.
The distance between passes is defined with the MMP parameter, specifying the minimum
overlap.
The MMF parameter may be used to reduce the feed during the approach to the workpiece.
The pass increment is defined with the MMV parameter. If MMV = 0, the pass increment is
executed in G1 on the internal side of working rectangle. If MMV = 1, the pass increment is
executed in G0 on the external side of working rectangle of 2mm.
Mandatory parameters:
first vertex coordinates of rectangular area (programmed through axes positions)
MMX: working plane first axis coordinate of rectangular area second vertex.
MMY: working plane second axis coordinate of rectangular area second vertex.
MMA: rapid approaching position
MMB: facing position
MMC: high retraction position
MMV=1 AA, AB
MMV=0 MMP
MMX, MMY
MMC
MMA MMB
D. ELECTRON 269
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
7.4 EXAMPLES
Example 1:
270
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Example 2:
Usage of the G801K7 positioning macro, with a part-program stored in CMOS program 40
S2000 M3 F800
(Program P40 defines the figure to be moved on circle points)
--DEFINE P40
G0X0Y0
Z2
G1Z0
Z-1
G1X10
Y5
X-10
Y-5
X10
Y0
G0X0Y0
Z2G0
G26
--END DEFINE
PAR[1]3
(G801K7 recall to position the figure stored in CMOS program
number 40)
(MPF=40: positions program 40)
(MPR=1: rotate the figure)
(positioning macro recall)
G801K7 MPX10 MPY20 MPC100 MPA0 MPL0 MPN8 MPS1 MPW1 MPF40 MPR1
G0 Z50
G0 Z50
M2
D. ELECTRON 271
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Example 3:
Usage of the G801K7 positioning macro, with a part-program stored in CMOS program 40
S2000 M3 F800
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).
272
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros
Example 4:
S2000 F1200 M3
G0 Z50
R5
(parameters and fixed cycle recall)
(MMA=0: upper pocket position)
(MMB=-20: lower pocket position)
(MMC=10: exit position at machining end)
(MMD=60: pocket diameter)
(X,Y: pocket center)
(MMK=3: pass depth)
(MME=2: safety distance)
G802 MMA0 MMB-20 MMC10 MMD80
G802K1 X10 Y10 MMK3 MME2
M2
D. ELECTRON 273
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros
Example 5:
Usage of the G802K1 machining macro (circular pocket roughing) as a fixed cycle:
S2000 F1200 M3
G0 Z50
R5
(parameters and fixed cycle recall)
(MMA=0: upper pocket position)
(MMB=-10: lower pocket position)
(MMC=10: exit position at machining end)
(MMD=30: pocket diameter)
(X,Y: pocket center)
(HX=1: use as fixed cycle)
(MMK=3: pass depth)
(MME=2: safety distance)
(MMW=1: ramp sinking)
(MMQ=4: maximum slope of sinking ramp)
274
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs
CHAPTER 8
Users The user canned cycles can be programmed directly by the end user, to suit his needs. When
canned the activated canned cycle number is 31 or higher the Z32 automatically searches the user canned
cycles cycle, which must be a subprogram resident in memory with a number equal to that of the activated
canned cycle.
For example with the instruction:
G27C100 the canned cycle in file number 100 is activated.
Rapid The user canned cycles do not stop the progressive number (unless G36H and G36S are used)
traverse and they do not stop line display: therefore a block search procedure inside a user canned cycle
can be performed (save for G36H/S).
The canned cycle sub-programs are, like all programs, sub-programs and tables, inserted in
memory through EDITOR or input from external sources.
Once a canned cycle is activated it is executed automatically after every programmed
TRAVERSE positioning. Even if a canned cycle is active, it will be not executed if movements are of
working type.
It is not possible to call a canned cycle inside a canned cycle, any traverse positioning inside the
canned cycle will not cause a canned cycle jump after their execution.
All the Z32 functions (traverse axes or working movements, stops, tool changes and auxiliary
functions...) can be programmed inside a canned cycle sub-program.
D. ELECTRON 275
Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual
276
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs
D. ELECTRON 277
Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual
278
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs
Parameters:
HA hole start position
HB hole end position
HC exit position
TT dwell time
Program 175:
BORING WITH SPINDLE STOP%
N1 G0 AC<HA>
N2 G1 AC<HB> M5
N3 G4
N4 G0 AC<HC>
N5 M3 G26
D. ELECTRON 279
Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual
INTERNAL MILLING%
N1 !IFHD<=2*R;EXCESSIVE TOOL RADIUS!
N2 G1 AC<HA>
N3 G2 AA<AA+HD/2-R> AB<AB> I<AA-HD/4+R/2> J<AB>
N4 AA<AA> AB<AB+.001> I<AA-HD/2+R> J<J>
N5 AA<I> AB<J> I<I+HD/4-R/2> J<J>
N6 G0 AC<HC> G26
NOTE:
N1 gives an error (field ! EXCESSIVE TOOL RADIUS! is an error of syntax) if the hole diameter
is not greater than the tool diameter. If instead the hole diameter is larger the incorrect field is not
executed and therefore the syntax error is not detected and work proceeds normally.
8.1.9 Example of Drill with working forward/reversal and stop at hole end
G27C9.... Composition:
1) traverse movement to hole start
2) working to hole end
3) dwell
4) working to hole start
5) traverse to exit position
Parameters:
HA hole start position
HB hole end position
HC exit position
TT dwell time
Program 178:
DRILLING WITH PAUSE AND RETURN IN WORKING%
N1 G0 AC<HA>
N2 G1 G4 AC<HB>
N3 AC<HA>
N4 G0 AC<HC> G26
280
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs
For the canned cycle the actual jump was obtained, after activation, by programming a
KG movement in G0; for the permanent sub-program the jump is obtained by programming (with sub-
executes program operating) the KG parameter in ISO line. For example:
spgr. ...
N10 G27P50
N11 X0 the sub-program is not executed
N12 KG1 executes
N13 X10 does not execute
N14 !KG=1! does not execute
N15 KG0 X50 executes
...
Contrary to what happens for canned cycles (for which the jump to the sub-program takes place
AFTER execution of the programmed traverse positioning), in the case of permanent sub-programs
the ISO line containing the KG that generates the jump is executed, but before the axis movements
there is a jump to the sub-program as parameters. Any movement must be ordered by the called
sub-program.
The reason for this is that the permanent sub-programs, as will be seen, are dedicated to the
special management of axis movement that can be manipulated inside the sub-program.
The value KG parameter, which generates the jump, may be any value. The value is passed to
the sub-program as it is programmed: KG can be controlled inside the sub-program and used to
perform execution variations.
The permanent sub-program can be inside any file, including protected files (over 128). The
canned cycle sub-programs can also be called as permanent sub-programs. In this case the
canned user cycles are called with the same number (over 30) whilst the canned system cycles are
called with the number of the sub-program (from 170 to 199) instead of the number of the canned
cycle (from 1 to 30).
During the execution of a permanent sub-program:
the sub-program lines are not displayed but the line of the beginning program remains
displayed
the progressive number is increased regularly (except for G36H) and so it is possible to
research a block inside a permanent program.
The jump to a permanent sub-program consumes one jump/return nesting level
A few possible applications:
execution of repetitive profile segments
modifying axes movements
specialized plane geometry
working in the space, 4 or 5 axes
electroerosion machining, 5 axes
In the following paragraphs we give two examples on the use of permanent sub-programs. Note
that the same machining may be done in another way (for example with !GOP...! or with jump to
series of lines). The use of permanent sub-programs makes the program simpler and more legible.
D. ELECTRON 281
Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual
SUB-PROGRAM 20
%
N1 G1 X<X> Y<Y>
N2 Y<Y-30>
N3 !IFKG=2;GON7!
N4 !IFKG1;ERROR KG PRG.20
N5 X<X+20> (GETS PLANE BOTTON)
N6 !GON9!
N7 X<X+10> Y<Y-5> (GETS INCLINED PLANE)
N8 X<X+10> Y<Y+5>
N9 Y<Y+30> (GOES UP TO START POSITION)
N10 G26
Please note how the use of a canned cycle would not have been possible due to the presence of
radius compensation (there cannot be segments in G0).
282
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs
PART-PROGRAM
%OX1OB1 F200
N1 G0X50B0 G27P90
activates the origins, moves traverse to profile start position and activates the permanent
program
N2 G98
begins special interpolation with straight segments
N3 KG1 HA50 HB0 X100 Y50
with HA and HB the sub-program is informed about the prior positions of X and Y axes
N4 KG1 X150 Y0
Segment programmed in XY
...
N20 KG1 X30 Y10
N21 G99 X<X>
end special interpolation with straight segments
N22 G27P0 G0 X200 B0
N23 M2
end permanent sub-program and traverse to final point
SUB-PROGRAM 90%
generates a sequence of linear movements in XB plane resulting in spiral arcs 0,5 mm. long in
XY plane
!IFKG=1;GON10!
different KGs can be managed here
....
ERROR KG1 IN PROGRAM 90
N10 HC<X-HA> HD<Y-HB>
HE<RQ(HC*HC+HD*HD)>
distance to cover and length of segment
HG0 HF<0.5/HE>
HG will change from 0 to 1 cover the of segment
N20!HG=HG+HF!
programmed, HF is its increment to divide
!IFHG>1;HG=1!
the segment is of constant length 0,5 mm.
!HX=HA+HC*HG;HY=HB+HD*HG;CP!
X<HR> B<HT>
arrives at XY point increased by 0.5 mm converted into polar coordinates
!IFHG<1;GON20!
repeats to end segment
G26
D. ELECTRON 283
Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual
284
D. ELECTRON
CNC Z32 Programming Manual Chapter 9 - Permanent Formulae
CHAPTER 9
9. PERMANENT FORMULAE
9.1 GENERAL
One of the characteristics of Z32 is that it can program parameters and axes positions through
mathematical formulae, for example:
X<HA+Y*0,01>
assigns to X , and to the programmed position on X axis, the value resulting from the
calculation enclosed in the acute brackets (HA parameter value plus one hundredth of Y parameter
value). The parameter values that a formula takes into consideration are the instantaneous values
when the CNC analyzes the line.
For the continuous axes only, it is possible to have Z32 recalculate a formula in a permanent
way, that is in real time, during the execution of programmed movements, taking as axes parameter
value the instantaneous interpolated point related to the active origin.
This function is obtained by programming the formula in double acute brackets in an ISO line on
the desired continuous axis. For example:
X<<X+0,1*Y>>
It is possible to program profiles, traverse movements etc. after the formula in an absolutely
normal way. The real axes movements will be changed by the formula introduced during their
execution. In the example case (for triad G25XYZ) the entire figure will have a 10% inclination on
the right.
Permanent formulae may be programmed in all continuous and alive axes, also in the axes not
directly involved in the movement. For example, if a machine has X, Y, Z and B axes and all axes
are alive (see the G28 functions) by programming on B axis a formula that unites its movement to
the other axes the four continuous axes can move simultaneously.
The permanent formulae are active both in working motions and in traverse motions.
The programmer must be careful when introducing a permanent formula. These precautions will
be explained in detail.
In the absence of permanent formulae, Z32 moves the axes after doing a series of calculations
that are:
1) programmed point analysis and their recalculation with roto-traslation, mirroring, scale
factor, if necessary.
2) determination of geometric paths and possible recalculation with radius compensation
3) verification that the calculated paths are inside the end position of the machine
4) determination of execution speed and possible slowing down in relation to programmed
speed, curvatures and edges of calculated paths
5) path interpolation in real time (calculation of next points calculation at a rhythm of about
500 times per second)
6) control of physical tracking errors (500 times per second) and of motion to all alive axes, to
keep the machine on path with minimum error.
The following figures were obtained with a few simple formulae realizing a part-program referred
to the normal figure (circle enclosing the lettering Z32) and introducing the formulae reproduced in
the figures.
D. ELECTRON 285
Chapter 9 - Permanent Formulae CNC Z32 Programming Manual
Between points 5 and 6, the introduction of a permanent formula requires that a further pass be
made 500 times per second:
5a) permanent formulae application on all alive axes involved, and point computation on the
deformed path equivalent to the calculated point on the origin path.
Speed
The difficulties that may derive from the introduction of a permanent formula are basically:
Problems the path execution speed is constant and corresponds to the programmed speed on the
original path. The accelerations are calculated for original path. On the deformed path
the speed and acceleration are also deformed and therefore may be either lower or
greater. This entails a further control that the speed does not exceed the traverse speed
and can lead to tracking errors if the speed increases too much in critical profile points.
The travel ends must not be controlled on the original path but on the deformed path
Travel ends which means the end of travel must be controlled in real time together with point 5a)
during the introduction of the permanent formula there may be a considerable difference
between the original point and the deformed point: Z32 gives a line conversion of the
start connection for every axis where the formula is introduced. The same operation
must be done when disabling the permanent formulae.
Time limitations Every permanent formula must be recalculated 500 times per second: that sets quite
stringent limitations to the complexity of formulae introduced.
286
D. ELECTRON
CNC Z32 Programming Manual Chapter 9 - Permanent Formulae
+ addition
- subtraction
* multiplication
/ division
brackets with nesting up to 10 levels
numerical constants (sign, 5 integers, 3 decimals)
PI constant (PI Greek = 3,141592...)
parameter addresses (e.g. R, HA etc.)
axes addresses (e.g. X, Y etc.)
The syntax of a permanent formula is the same as that of a normal formula, except for complex
mathematical operations (for reasons of execution time) (RQ square root, SN sine, CS cosine, AT
arctangent).
Examples of formally correct formulae:
X<<X*0,9>> introduces a scale factor of 90% on X axis
X<<0>> keeps the axis stopped at zero
X<<X+1>> moves X origin +1mm: it makes heavier computer work unnecessary.
It is better to move the origin or introduce a traslation (DA)
X<<X+0,001*Y*Y>> introduces a parabolic deformation on X axis
D. ELECTRON 287
Chapter 9 - Permanent Formulae CNC Z32 Programming Manual
Permanent formulae activation is obtained with an ISO line containing even only one permanent
formula. Disabling is obtained by programming null formulae and variation by simply programming
the new formulae.
All permanent formulae to be cancelled must be programmed, for reasons which will be
explained better in the following paragraph.
Example:
N1 X<<X*0,96>> B<<B*RX/100>> enabling: from now on the formulae are operating
on the X and B axes
N50 X<<X*0,9>> Y<<Y*0.8>> B<<>> variation on X axis, disabling of B and enabling of Y
N100 X<<>> Y<<>> disabling on all axes with active formulae, that is X
and Y
If the programmer wants to add permanent formulae to formulae already operating, he may
program a formula with ! initial character.
For example:
N10 X<<X*.97>>
...
N12 Y<<!Y*.8>>
If a new formula is programmed on an axis which already has a permanent formula, the old
formula is disabled but not deleted from the memory: hence from the length point of view (and of
the alarm CN3814 <<FORMULA TOO LONG>>) the new formula is added to the previous one.
288
D. ELECTRON
CNC Z32 Programming Manual Chapter 9 - Permanent Formulae
This characteristic permits, as shall be seen later, the connection associated to a permanent
formula to be avoided.
The situation is the same in the case of disabling or variation of a permanent formula. Also in
this case the machine point may be shifted due to the formula and therefore a connection has to be
introduced.
It should be noted that the presence of even a single permanent formula in an ISO line implies
the cancellation of all the formulae. Since the connection is calculated only for the formulae actually
programmed, is all the formulae previously activated are not closed, there can be CN0113 or
CN0013 alarms due to the resulting discontinuity of movement.
The following examples illustrate the behaviour of the Z32 with regard to connections in extreme
situations which in all probability will never occur in practice.
N. 1 Example
...
N10 OX1 OY1 OZ1 X0Y0Z0 F1000 disables origin 1 and axes move to origin
N20 X<<X*0.9>> permanent formula activation: the initial connection has
a null length because the old point (X = 0) coincides
with new point (X = 0*0.9 = 0).
N30 X100 move to X90 because of the formula
N40 X<<>> formula disabled and final connection from old point
calculated with the formula (X = 90) to new point (X = 100)
...
N. 2 Example
...
N10 X100Y100Z0OX1OY1OZ1 F1000
N20 X<<X*0.9>> Y<<Y*0.8>> parallel movement of X axis from 100 to 90 (F1000 speed)
and then parallel movement of Y axis from 100 to 80
N30 X200 X axis moves from 80 to 160
N40 X<<>> X formula disabled and final connection from 160 to
X200. It was an error not to have disabled also formula
Y: the consequences will be seen the first time axis Y is
programmed.
N50 X100 X axis moves from 200 to 100 correctly
N60Y100 CN0013 alarm due to not having disabled Y formula
...
N. 3 Example
...
N10 X100Y100Z0 OX1OY1OZ1 F1000
N20 Y<<Y*0.8>> X<<X*0.9>> the connection sequence is different from example 2
because the order of programming is different. Y
connection from 100 to 80 is done before X connection
from 100 to 90.
...
N. 4 Example
...
N10 X100Y100Z0 OX1OY1OZ1 F1000
D. ELECTRON 289
Chapter 9 - Permanent Formulae CNC Z32 Programming Manual
N. 5 Example
...
N10 X100Y100Z0 OX1OY1OZ1 F1000
N20 X50 X<<X*0.8>> the result is identical to the previous example, the initial
connection goes from X100 to X40
...
N. 6 Example
...
N10 X100Y100Z0 OX1OY1OZ1 F1000
N20 X<<X*0.8>> X50 an initial connection from X100 to X80, then the
programmed movement to X40 (equivalent to 50*0.8)
done with formula operating.
...
N. 7 Example
...
N10 X100Y100Z0 OX1OY1OZ1 F1000
N20 X50 X<<X*0.8>> X100 an initial connection to X40 then the programmed
movement to X80 (equivalent to 100*0.8)
...
N. 8 Example
...
N10 X100 Y100 Z0 OX1 OZ1 F100
N20 X50 Y40 X<<X*0.7>> Y<<Y*0.6>> X30 Y60
... first, connection in X from 100 to 35, then the
connection in Y from 100 to 24, then an inclined
movement in XY with formulae operating up to final
point resulting X21 Y36
The programmer should consider examples 6, 7 and 8 as a means to better understand how the
Z32 behaves: they are not examples to be followed as they complicate unnecessarily an already
complex line which contains the activation of permanent formulae. The movements programmed
after the permanent formulae can be realistically programmed in a SUBSEQUENT line.
290
D. ELECTRON
CNC Z32 Programming Manual Chapter 9 - Permanent Formulae
into machine language during the analysis of the line that contains them. A formulae compilation
permits the fastest execution. During compilation the following operands may be encountered, apart
from the mathematical operators :
constants and parameters
axes names (unknowns)
The parameters are considered as constants and they are introduced in the compiled formula
with the value they have during the formula compilation.
The axes names instead must be considered as unknowns because they change continuously
during the movement. The function of the compiler is to optimise the formula by performing once
only, during the compilation, all the possible calculations and leaving (to be executed 500 times per
second) only the calculations that involve unknowns (axes names).
For example, the formulae:
X<<X*0,9>> and X<<3*X*0,3>>
are executed (at 500 times per second level) in exactly the same time: the second formula
needs only a little supplementary work (negligible because it is executed only once during the
compilation) to calculate the multiplication factor of the unknown X.
During the compilation, Z32 controls the compiled formula length and the time necessary for its
execution: if either exceed the maximum admitted Z32 gives message and error:
CN3814 <<FORMULA TOO LONG>>
D. ELECTRON 291
Chapter 9 - Permanent Formulae CNC Z32 Programming Manual
292
D. ELECTRON
CNC Z32 Programming Manual Chapter 9 - Permanent Formulae
The values obtained with the permanent formula, multiplied by two, also multiply feedrates and
accelerations: precautions must be taken to avoid excessive tracking errors (e.g. piece test to avoid
traverse).
The dynamic machine performances are not utilized completely if the multiplication factor is less
than 1.
In the case of a formula with * the machine settings related to the axis involved are modified
automatically (in practice traverse and maximum axis acceleration are divided by the multiplication
factor) to bring them back to the real machine on the real path.
The <<*>> formula is very useful when programmming cylindrical profiles obtained with one
rotating axis and one linear axis.
9.1.10 Applications
The permanent formulae, even with the objective difficulties and limits mentioned above, can be
useful in performing machining which would otherwise be difficult if not impossible.
Probably the most sensitive limit of the permanent formulae is that of axis feedrate, which
becomes different from the programmed feedrate. As a general recommendation, ensure, as far as
possible, that the formulae reduce rather than enlarge. For example, if an elliptic movement of the
milling machine is desired, multiply the shortest axis by a number smaller than 1 rather than the
longest axis by a number greater than 1.
G108 may be used for enlarging formulae to bring the acceleration and the feedrate within
tolerable limits.
Ellipses
As shown in the examples at the beginning of the chapter, a circle with axes in a different scale
factor becomes an ellipsis.
WARNING
When contouring an ellipsis the milling machine does NOT travel an
ellipsis path. If a different scale factor is applied to the two axes and
radius compensation is not active a true ellipsis will not be obtained. The
nearer the tool radius is to the radii of curvature of the profile, the greater
will be the error in shape.
D. ELECTRON 293
Chapter 9 - Permanent Formulae CNC Z32 Programming Manual
Z<<Z+HA*X+HB*Y>>
the vertical movement of axis Z is tied to the horizontal position of axes X and Y.
With suitable modification to the HA and HB coefficients the tool moves exactly on the inclined
plane.
294
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
CHAPTER 10
10. GEOMETRY
10.1 GENERAL
The Z32 has a complete set of instructions to resolve the calculus problems of a geometric
contour no matter how complex.
Contours consisting of rectilinear and circular segments, with linear and circular chamfers and
connections, are easily programmed.
It is possible to coordinate with a movement on the plane a movement in the third axis (see
paragraph Profiles on three axes further on in this chapter).
The programs realized with basic Z32 geometry with previous software may be executed also
with the new geometry without any changes.
D. ELECTRON 295
Chapter 10 - Geometry CNC Z32 Programming Manual
Each segment is distinguished by the information contained in previous geometric entity and by
that contained in the current step; every segment may end with a straight chamfer (only between
rectilinear segments) or with a circular connection.
Continuous A continuous point is a tangency point betwen two segments (segment/circle or
point circle/segment).
Each segment may be defined in many ways: these syntactic forms are the Z32 geometry
instructions.
End positions
The end positions represent the end point coordinates to be reached on the working plane.
The end positions are programmed with the axis name (for example X, Y, Z...) or in equivalent
way with AA parameters (first axis), AB (second axis) and AC (third axis). AA AB and AC
parameters are used to create generic sub-programs, free from the actual working plane. The
explicit axes names, X for the first axis, Y for the second axis and Z for the third axis (spindle axes)
will be used in the future for the sake of brevity and for clarity.
The Cartesian plane is defined by the first horizontal axis and by the second vertical axis.
QF end inclination
This is the angle between the positive direction of X axis and the direction of the movement at its end.
296
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
RB chamfer
A chamfer with RB parameter may be programmed at the end of a rectilinear segment.
RB programmed value determines the chamfer length in the first segment.
The chamfer length in the second segment is:
RB if QA is not programmed
RB*tg QA if QA is programmed
The next segment must still be rectilinear: the chamfer is admitted only between two rectilinear
segments. It is mandatory that RB and QA be programmed in the segment at the end of which the
chamfer is to be inserted. See paragraph on Automatic Chamfers
If RB is programmed in a step where it is not allowed it gives programming errors:
CN4214 RB at circle beginning
CN4314 RB at circle end
CN4514 RB/RR at starting point (continuous)
D. ELECTRON 297
Chapter 10 - Geometry CNC Z32 Programming Manual
KA selection parameter
An open segment may be closed by the next segment for intersection of two geometric entities.
If at least one of these entities is a circle there are two solutions (or one if the entities do not
intersect).
Bends to right
Bends to left By observing the movement with reference to the first programmed entity, it can be seen that
one of the solutions bends to the right and the other to the left.
One of the two solutions causes a short connection (connection length less than half circle) and
the other causes a long connection (connection length more than half circle) if the radius of RR
connection is programmed. See paragraph on Automatic Connections.
The choice of the solution is made with KA parameter (it is mandatory that it be programmed in
open step where we want to choose the intersection):
KA=0 short connection if RR programmed, bends to the left if RR not programmed
KA<>0 long connection if RR programmed, bends to the right if RR not programmed
If KA is programmed in a block where it is not allowed it does not give alarms: it simply has no
effect; KA=0 may be omitted.
KA=1 KA=
298
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
QA auxiliary inclination
QA parameter permits to program an auxiliary angle like QF.
The first application regards the programming of the chamfers between two lines, another
regards the line-circle combinations G1 G2/G3..QA type. The meaning is specified in the paragraph
on Line-Circle combinations.
Preparatory functions
The functions involved are G1, G2, G3 which are modal and mutually exclusive.
An already active G may be not programmed; in the following this possibility will be indicated with
round brackets: (G1) or (G2/G3).
G2 and G3 programmed functions may be forced, i.e. the Z32 can change the direction of travel
whenever the circle arc is connected to the previous segment. In this way the tangency condition is
privileged and edges are avoided. In the following [G2/G3] notation will indicate this situation.
Z32 geometry includes powerful line-circle combinations consisting of a line followed by a
tangent circle. These combinations are identified by the composite preparatory functions G1G2 and
G1G3 depending on whether the circle is clockwise or counter-clockwise. G1G2 and G1G3 are not
modal and are active only in the block.
D. ELECTRON 299
Chapter 10 - Geometry CNC Z32 Programming Manual
300
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
The Z32 does not recognize different combinations and it gives the alarm message CN2C14
(INCOMPATIBLE PARAMETERS).
Some segments (G1, G1 QF, G2/G3 I J RA, G2/G3 RA, G1 G2/G3 I J RA, G1 G2/G3 I J RA
QA) are open because the segment end positions are not determinable by programmed
parameters in the block.
The other segments are closed, because they have completely determined end positions.
Open segments may be:
1. line whose inclination and start point are defined
2. circle whose centre and start point are defined
3. circle whose centre and the radius are defined
4. circle whose radius and start point are defined
The parameters taken into consideration by Z32, to define a contour segment, are exclusively
those listed (XY axes position, I J circle centre, RA radius, QF inclination, QA auxiliary inclination,
RR connection, RB chamfer, G1 G2 G3 preparatory functions): other parameters or functions may
be programmed in the same line and if they are compatible, and will be handled without causing
errors.
G1 X.. Y..
Line 1 may come from definite point or from open circle, in this case the tangency condition is
forced to a continuous point. If the previous segment is an open line the error message CN3214 will
appear (previous block wrong).
If the end point is inside a previous circle the error message CN3314 will appear (inside circle)
...
G0 X35 Y0
G1 Y10 RB1
(G1) X20
(G1) Y20 RB2
(G1) X0 QF180
....
D. ELECTRON 301
Chapter 10 - Geometry CNC Z32 Programming Manual
.....
G1 X12 Y0
G3 I0 J0 RR-2 (KA0)
G1 Y25 X-40 QF160
X-50 QF180
......
RR is negative because the connection is clockwise and KA is zero because the connection is
short.
302
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
All open lines may have connections and chamfers at the end of the segment.
If the next inclined is line 6, KA programming is not influential.
Open line programming examples:
.....
G0 X70 Y0
G1 Y10
X62
(G1) X25 Y21,63
G1
QF180 X0 Y28
.....
....
G0 X0 Y0
G1 Y10
G1 QF150
G2 I-20 J30 RA10
G1 X-50 Y30 QF180
.....
D. ELECTRON 303
Chapter 10 - Geometry CNC Z32 Programming Manual
....
G0 X30 Y0
G3 I15 J0 KA1
I0 J15 Y30 X0
....
304
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
..... .....
..... G0 X20 Y-1
G1 QF45 G1 QF90
G2 I20 J0 QF-90 G3 I0 J0 RA20 QF-150 KA1
.... (G3) I-20 J0 QF180
....
....
G0 X0 Y20
G2 I10 J15 QF-60
G3 RA20 QF30
.....
D. ELECTRON 305
Chapter 10 - Geometry CNC Z32 Programming Manual
......
G0 X0 Y10
G2 X10 Y0 I0 J0
G2 X50 Y0
I70 J0 X90 Y0
G3 X110 Y0
I120 J0 X130 Y0
.....
G2/G3 I J QA
The circle 7 may come from a defined point or an open straight line, in which case the tangency
condition is imposed with the previous section and is forced, only on block, in the sense of run so as
to avoid any sharp edges.
If the previous section is an open circle an error occurs CN3214 (previous block wrong)
By programming the parameters I,J,QA it is also possible to program the complete circle.
The programming format is:
G2/G3 I... J... QA...
Where:
G2 or G3 specifies whether the direction is clockwise or anti-clockwise.
I and J are the centre coordinates (I = first axis, J = second axis)
QA is the length in degrees of the required arc. For QA only positive values of between 0 a
360.001 are permitted.
Different values generate error CN2C14 INCOMPATIBILE PARAMETERS
QA values of between 359.999 and 360.001 are interpreted as being of 360.000 degrees and
form a complete circle.
Tolerance of around 360 has been introduced in the case that this 360 has been obtained from a
calculation, which in floating point could cause uncertainty in the decimals and therefore generate
execution uncertainty (degreed or zero).
Examples:
G0 X20 Y10
G3 I40 J15 QA180
Generates the arc of an anti-clockwise circle starting from point X20 Y10, with centre at in X40
Y15 (therefore radius 20.6155) of 180 degrees length.
G0 X20 Y10
G3 I40 J15 QA360
As above, but generating a complete 360 degree circle.
An RR connection may be programmed in every closed circle arc and it is executed at the end of
the segment.
306
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
....
G0 X0 Y50
G1 QF-90 KA1
G3 I-2 J10 RA30 KA1
G1 X-40 Y11 QF180
Y45
X0
.....
D. ELECTRON 307
Chapter 10 - Geometry CNC Z32 Programming Manual
...
G0 X45 Y0
G1 Y10
QF150
G3 I25 J3 (KA0)
G2 I15 J25 RA10 QF180
G1 X0
...
G2/G3 RA...
Circle 10 must come from defined point and the inclination of the previous segment is
maintained in this point. It is a circle tangent to the previous segment. If the previous segment is
open the error message CN3414 will appear (previous block open).
.....
G3 I30 J0 X30 Y20
G2 RA10
G1 X0 Y40 QF160
.....
An RR connection may be programmed in every block and is executed at the end of the
segment.
308
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
The alarm message CN3314 appears in the situations shown in the figures.
Accordant circles: none must be contained inside the other.
Discordant circles: the two circles must be exterior one to the other.
D. ELECTRON 309
Chapter 10 - Geometry CNC Z32 Programming Manual
...
G0 X0 Y0
Y10
QF180 KA1
G3 I-20 J5 RA15 KA1
G1G3 I-50 J20 X-60 Y25 QA150 KA1
G1 QF180
G1 X-90 Y20 QF-90
....
G1 G2/G3 I.. J.. RA.. QA.. G1 G2/G3 I.. J.. RA.. QA.. QF..
Combinations 5 and 6 are similar to combination 4 but use different parameters.
G200 HX4
force, for the subsequent lines the execution of the complete circle when the arc of the circle is
programmed with G2/G3 I J X Y and the end values are identical to the initial values.
310
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
Example:
N1 G200 HX4
N2 G0 X25.23 Y10.759
At line N3 a complete circle is executed with centre I40 J10 and departure and arrival at point
X20Y10.
The identical value condition is definitely obtained if the values are programmed with explicit
identical numbers, as in the above example, or if they are the result of identical formulas.
WARNING
Mathematical formulas which appear to be identical in substance but
different in form may generate different results, due to the mobile point
calculation features.. For example the expression 1.2*5 does not give the
result of exactly = 6, because the basic decimal number 1.2 cannot be exactly
represented in the binary system (as it is a periodic number such as for
example 1/3=0.33333... which is periodic in the decimal system) so that the
result is not an integer. It is therefore very difficult to predict the result, so
that when totally identical numbers are required as in this case, it is advisable
to program explicit numbers or totally identical formulas.
In some application the condition of perfectly identical mathematical formulas has not been
implemented; in such cases the roto-translation of a part-program may bring to uncertain behavior
(complete circle executed or not).
The Z32 software consider a tolerance: if the end positions of both axes interpolating the circle
8
differ from the initial position less than 1/10 (for example 1 micron on a 100 position) the two
positions are considered as identical and a complete circle is executed.
D. ELECTRON 311
Chapter 10 - Geometry CNC Z32 Programming Manual
G0 X0 Y0
G1 X20 Y20 RB15 QA30
(G1) X40 Y0
or
G1 X20 QF45 RB15 QA30
(G1) Y0 QF-45
(QA30 =>tg30 = 8.66/15)
G0 X0 Y20
G1 X30 Y20 RB10
(G1) X40 Y0
G0 X0 Y20
G1 QF90
X40 Y20 QF0 RB15 QA30
(G1) Y0
(QA30 =>tg30 = 8.66/15)
312
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X0 Y20
G1 X30 Y20 RB10
(G1) QF-90
or
G1 QF0 RB10
(G1) X30 Y0 QF-90
G0 X0 Y20
G1 X30 Y20 RB10
G1
alarm CN4514
RB/RR at starting point (continuous)
G0 X-5 Y-5
G1 X5 Y5
(G1) RB10
(G1) X40 Y0 QF-45
G0 X5 Y0
G1 Y20 RB10
G1G2 I30 J10 RA10
G1 X10 Y0
D. ELECTRON 313
Chapter 10 - Geometry CNC Z32 Programming Manual
G0 X0 Y0
G1 QF60 RB15 QA30
G1G2 QA-30 I35 J0 X45 Y0
or
G1G2 QA-30 I35 J0 RA10 QF-90
(QA30 =>tg30 = 8.66/15)
G0 X0 Y0
G1 QF60 RB10 QA40,9
G1G2 QA-30 I35 J0 RA10
(QA40,9 =>tg40,9=8.66/10)
G0 X0 Y-25
G1 Y25 RB20
G1G2 I10 J0 RA20 QF-90
If the chamfer falls into the circle the Z32 will not give alarm message.
314
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X0 Y0
G1 X20 Y20 RR-10
(G1) X40 QF-45
or
G1 X20 QF45 RR-10
(G1) Y0 QF-45
G0 X40 Y0
G1 X20 QF135 RR10
(G1) X0 QF-135
G0 X0 Y0
G1 X35
G1 QF0
(G1) X35 Y20 QF90 RR10
(G1) X0
G0 X0 Y0
G1 Y20 RR-10
(G1) QF0
G0 X0 Y20
G1 QF0 RR-10
(G1) X30 Y0 QF-90
D. ELECTRON 315
Chapter 10 - Geometry CNC Z32 Programming Manual
G0 X30 Y0
G1 Y20 RR10
(G1) QF180
or
G1 QF90 RR10
(G1) X0 Y20 QF180
G0 X-5 Y-5
G1 X5 Y5
(G1) RR-10
(G1) X50 Y0 QF-45
G0 X0 Y10
G1 X20 Y10 RR-5
G3 I35 J10 X35 Y-5
G0 X0 Y10
G1 X20 Y10 RR5
G2 I35 J10 X35 Y25
or
G2 RA15 X35 Y25
G2 I35 J10 QF0
G0 X0 Y0
G1 QF60 RR-5 (KA0)
G3 I30 J10 X30 Y-5
(G3 I30 J10 RA15 QF0)
316
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X0 Y0
G1 QF60 RR-5 KA1
G3 I30 J10 X15 Y10
(G3 I30 J10 RA15 QF-90)
G0 X25 Y40
G1 QF-120 RR18 (KA0)
G3 I30 J10 X45 Y10
(G3 I30 J10 RA15 QF90)
G0 X25 Y40
G1 QF-120 RR18 KA1
G3 I30 J10 X30 Y25
(G3 I30 J10 RA15 QF180)
G0 X0 Y10
G1 QF0 RR-3 KA1
G3 I30 J10 X30 Y25
G0 X0 Y10
G1 QF0 RR3 (KA0)
G3 I30 J10 X15 Y10
G0 X0 Y10
G1 QF0 RR-3 (KA0)
G3 I30 J10 X30 Y-5
D. ELECTRON 317
Chapter 10 - Geometry CNC Z32 Programming Manual
G0 X0 Y10
G1 QF0 RR-3 KA1
G2 I30 J10 X30 Y25
G0 X0 Y10
G1 QF0 RR3 (KA0)
G2 I30 J10 X45 Y10
G0 X0 Y20
G1 X15 Y20
G2 X30 Y5 RR-5
G1 X0
G0 X0 Y20
G1 X15 Y20
G2 RA15 QF-90 RR5
G1 X0 Y5
G0 X25 Y0
G3 I10 J0 X10 Y15 RR-5
G1 X10 Y0
G1 X10 Y-5
G2 I10 J15 RR-5 (KA0)
G1 X40 Y15 QF0
318
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X9 Y27,5
G1 QF0
G2 I10 J12,5 RA15 RR-5 KA1
G1 X40 Y15 QF0
G0 X9 Y27,5
G1 QF0
G2 I10 J12,5 RA15 RR5 (KA0)
G1 X40 Y15 QF0
G0 X1 Y-10
G1 QF180
G2 I0 J0 RA10 RR-20 KA1
G2 I20 J0 RA5 QF90
G0 X-10 Y18
G1 QF-90
G3 I0 J15 RA10 RR-10 (KA0)
G3 I20 J15 X25 Y15
G0 X0 Y10
G3 I0 J15 RR-10 KA1
G3 I20 J15 RA5 QF0
D. ELECTRON 319
Chapter 10 - Geometry CNC Z32 Programming Manual
G0 X-10 Y15
G3 I0 J15 RR15 (KA0)
G2 I20 J15 X25 Y15
G0 X10 Y14
G1 QF90
G3 I0 J15 RA10 RR15 KA1
G2 I20 J15 X25 Y15
G0 X-10 Y14
G1 QF90
G2 I0 J15 RA10 RR15 (KA0)
G3 I20 J15 X25 Y15
G0 X-10 Y14
G1 QF90
G2 I0 J15 RA10 RR15 KA1
G3 I20 J15 X20 Y10
Secant circles
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR4 (KA0)
G2 I25 J0 X25 Y20
320
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR-4 (KA0)
G3 I25 J0 X25 Y-20
G0 X15 Y1
G1 QF-90
G2 I0 J0 RA15 RR4 KA1
G2 I25 J0 X25 Y20
G0 X15 Y1
G1 QF-90
G2 I0 J0 RA15 RR-4 KA1
G3 I25 J0 X25 Y-20
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR-4 KA1
G2 I25 J0 X25 Y20
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR4 (KA0)
G3 I25 J0 X25 Y-20
D. ELECTRON 321
Chapter 10 - Geometry CNC Z32 Programming Manual
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR-4 (KA0)
G2 I25 J0 X25 Y20
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR4 KA1
G3 I25 J0 X5 Y0
Internal circles
G0 X11,5 Y10
G1 QF0
G3 I12,5 J15 RA5 RR-8 (KA0)
G2 I25 J15 RA20 QF0
G0 X13,5 Y20
G1 QF180
G3 I12,5 J15 RA5 RR-8 KA1
G2 I25 J15 RA20 QF90
G0 X11,5 Y10
G1 QF0
G3 I12,5 J15 RA5 RR8 (KA0)
G3 I25 J15 RA20 QF0
322
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X13,5 Y20
G1 QF180
G3 I12,5 J15 RA5 RR8 KA1
G3 I25 J15 RA20 QF0
G0 X26 Y-5
G1 QF180
G2 I25 J15 RA20 RR-8 (KA0)
G3 I12,5 J15 RA5 QF180
G0 X5 Y14
G1 QF90
G2 I25 J15 RA20 RR-8 KA1
G3 I12,5 J15 RA5 QF-90
G0 X26 Y35
G1 QF180
G3 I25 J15 RA20 RR8 (KA0)
G3 I12,5 J15 RA5 QF180
G0 X26 Y35
G1 QF180
G3 I25 J15 RA20 RR8 KA1
G3 I12,5 J15 RA5 QF-90
D. ELECTRON 323
Chapter 10 - Geometry CNC Z32 Programming Manual
External circles
If the circles are external we will have (| .. | absolute value):
accordant circles/discordant connection |2xRR|>=D-RA1-RA2
accordant circles/accordant connection |2xRR|>=D+RA1+RA2
discordant circles/connection like the first |2xRR|>=D+RA2-RA1
discordant circles/connection like the second |2xRR|>=D+RA1-RA2
Secant circles
If the circles are secant we will have:
accordant circles/internal connection |2xRR|<=D-RA1+RA2-D
discordant circles/internal connection |2xRR|<=D-RA2+RA1
|2xRR|<=D-RA1+RA2
concordant circles/external concordant connection |2xRR|>=D+RA1+RA2
Internal circles
If the circles are internal we will have:
concordant circles RA2-D-RA1<|2xRR|<RA2+D-RA1
discordant circles RA2D+RA1<|2xRR|<RA2+D+RA1
324
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
D. ELECTRON 325
Chapter 10 - Geometry CNC Z32 Programming Manual
326
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
D. ELECTRON 327
Chapter 10 - Geometry CNC Z32 Programming Manual
328
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
D. ELECTRON 329
Chapter 10 - Geometry CNC Z32 Programming Manual
330
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
is reduced with respect to the radius of curvature of programmed contour. This means
the feedrate of execution of the contour is kept constant rather than the feedrate of
traslation of the tool centre. For safety reasons an increase of feedrate of the tool centre
is not provided for in case of external curvature.
The central part at constant feedrate may not exist if the resulting length of the acceleration and
deceleration is longer than the length of the whole segment.
D. ELECTRON 331
Chapter 10 - Geometry CNC Z32 Programming Manual
332
D. ELECTRON
CNC Z32 Programming Manual Chapter 11 - Rotation, Tanslation, Mirroring, Scale Factor
CHAPTER 11
The parameters used for these functions are modals, like all parameters, that is the
Execution programmed value remains until a new value replaces the previous one.
order The parameters are set to zero at reset, except for KP and KT which are set to 1 to have a
unitary scale factor.
If several transformations are operating the Z32 will work as follows:
1) Rotation: is applied to AA, to AB, to I and J circle centre, and to QF inclination.
2) Traslation: is applied to AA, AB and AC positions, to I and J circle centre, already
rotated if necessary.
D. ELECTRON 333
Chapter 11 - Rotation, Tanslation, Mirroring, Scale Factor CNC Z32 Programming Manual
3) Mirroring: the centre of mirroring IS, JS, and the inclination of QS mirroring axis are
attributed to not roto-traslated origin. The mirroring is applied to AA and AB positions, to
I centre circle and to QF inclination, already roto-traslated. If G2/G3 and G41/G42
operating they are exchanged.
4) Scale factor: the dimensions resulting from the three previous transformations related to
unmodified origin are multiplied by the scale factor. Dimensions AA, AB, AC circle
centre I, J and RA radius are concerned.
The above calculi are performed only to determine the movements of the axes and do not
change the parameters. For example, if AA 100 is programmed and the changed position is 150
(because of roto-traslation, mirroring, scale factor), the AA parameter, used in the next calculus, will
keep 100 value and will not assume 150 value.
The G53 (origins and length compensation off) also suspends roto-traslation, mirroring and
scale factor.
That permits the programming of the machine movements in fixed points (tool change is typical)
without cancelling the dimensions transformations that may be restored by a subsequent G54.
11.2 ROTATION
The programmed figure is rotated by an angle QR (on sexagesimal degrees) around the centre
whose rotation (IR, JR) whose coordinates are referred to the active origin.
If QR is different from zero the rotation will be always possible (it does not need a particular G).
At reset QR = IR = 0
The rotation is applied to:
(AA, AB) axes positions
(I, J) circle centre
(QF) inclination
334
D. ELECTRON
CNC Z32 Programming Manual Chapter 11 - Rotation, Tanslation, Mirroring, Scale Factor
Up to instruction N3 the three programs are identical and take the axes into origin OX1 OY1.
With instruction N4 the parameters X and Y are both zero, i.e. they would identify the new origin
OX2 OY2. The movements obtained are those shown in the figure. Only if both axes are
programmed (progr. 3) will the new origin be reached, otherwise only the programmed axis moves.
If the rotation is operating (QR not zero) the programming of only one axis (motion parallel to an
axes of the unrotated figure) actually causes an inclined movement and hence will request also the
movement of the other axis.
Therefore, if QR is not zero, even if only one axis is programmed, the Z32 does not limit the
movement to the programmed axis alone, but moves both axes in order to reach the rotated point
with an inclined path. In the following example the behaviour of the machine is different from the
previous example:
NOTE:
N1 QR = IR = JR = 0 at reset
N3 does not produce axes motion because no position is programmed
N4 Y moves to the position 0 (parameter value), even if only X is programmed, because QR
is not zero
N6 being QR=0, although containing Y parameter having zero value, axis Y does not move
D. ELECTRON 335
Chapter 11 - Rotation, Tanslation, Mirroring, Scale Factor CNC Z32 Programming Manual
11.3 TRASLATION
The programmed profile is traslated by the DA (first axis), DB (second axis), DC (third axis)
quantities.
If one or more of the three parameters DA, DB, DC are not zero, the traslation will be performed
(without need of particular G).
DA = DB = DC = 0 At reset.
The traslation is applied to:
(AA, AB, AC) axes positions
(I, J) circle centre
336
D. ELECTRON
CNC Z32 Programming Manual Chapter 11 - Rotation, Tanslation, Mirroring, Scale Factor
11.4 MIRRORING
The programmed profile is changed in the mirror profile with respect to the mirroring axis located
by the point of coordinates (IS, JS) and by QS inclination.
The mirroring must be qualified by G56 (modal). G55 cancels G56 and hence the mirroring.
IS = JS = QS = 0 At reset, G35 is operating (mirroring not operating).
The mirroring (G56 operating) causes the exchange of G2 with G3 and of G41 with G42.
G56 may be operating in radius compensation (G41/G42) but cannot be programmed with
G41/G42 operating.
The mirroring axis is the line of inclination QS and passing through the point of coordinates IS,
JS, QS. IS, JS are referred to the active origin and are not roto-traslated.
The mirroring is applied to:
(AA, AB) axes positions
(I, J) circle centre
(QF) inclination
D. ELECTRON 337
Chapter 11 - Rotation, Tanslation, Mirroring, Scale Factor CNC Z32 Programming Manual
The programmer must take care because, during radius compensation, the scale factor can
transform the contour from compatible to incompatible and vice versa if there are undercuts greater
than the tool radius. Please refer to Chapter on Tool Radius Compensation.
338
D. ELECTRON
CNC Z32 Programming Manual Chapter 11 - Rotation, Tanslation, Mirroring, Scale Factor
D. ELECTRON 339
Chapter 11 - Rotation, Tanslation, Mirroring, Scale Factor CNC Z32 Programming Manual
340
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 - Tool Radius Compensation
CHAPTER 12
Note:
Inner corners cannot be worked because of tool radius (X zones)
A few connection segments are inserted around exterior corners (B and D)
A few programmed segments are eliminated because of tool radius (segment 5)
Generally, if radius compensation is operated (with G41/G42) in a program, the Z32 will execute
in every segment of the programmed profile a series of operations to modify the path of the milling
centre.
The main operations Z32 performed on the programmed segments to obtain the path of the
milling centre are:
D. ELECTRON 341
Chapter 12 Tool Radius Compensation CNC Z32 Programming Manual
This last performance requires to Z32 to explore profile ahead to obtain necessary information.
The next segments of programmed profile can in fact interfere with the actual segment and
therefore require a different end point for the actual segment.
342
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 - Tool Radius Compensation
Segment 9 interferes with segment 1 in the example of the figure: to resolve this case the CNC
should explore ahead for at least 9 segments in addition to the inserted connections around the
corners.
The number of explored segments has been limited because of physical limits, imposed by
memory size and by calculus times, also considering that no matter how many segments are
calculated by CNC, it is always possible to imagine a more complex profile.
Normal cases of profile can be solved with two segments forward: if the programmer does not
require different performance, the Z32 will explore ahead until it has defined two segments of the
profile following that under examination (three segments in all).
For example, considering the classical case of a step whose height is lower that the tool radius:
this is fully solved by Z32 by exploring three segments.
The segments that comprise the outline modified with tool radius are:
1. start horizontal segment
2. circular connection around programmed corner
3. vertical segment
4. end horizontal segment
D. ELECTRON 343
Chapter 12 Tool Radius Compensation CNC Z32 Programming Manual
344
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 - Tool Radius Compensation
D. ELECTRON 345
Chapter 12 Tool Radius Compensation CNC Z32 Programming Manual
If the same figure were executed with three segments (the normal G109A) the CNC would not
notice the narrower tool aperture and it would enter the profile.
It is also possible to program G109R function that forces the insertion of a connection around
inner corner eliminating INADMISSIBLE PROFILE error.
G109N eliminates G109R, which can be programmed immediately before steps that cause
INADMISSIBLE PROFILE: so the situation that causes the alarm will be clearer.
The tool can go into the programmed outline with G109R operating and long connections can
remain on inner corners in case of complex profile.
346
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 - Tool Radius Compensation
The advantage of this method is that if the inclination is programmed correctly, the tool will enter
on the profile along the tangent line and slightly mark the profile.
There are two disadvantages on the other hand:
QF calculus may not be very simple
the connection to profile is not considered a profile element and so if it interferes with the
next profile segments it is not shortened.
Example with incorrect QF:
....
T2 M6 (RADIUS=10)
G0 X0 Y0
G41 X25 Y0 QF0 (QF incorrect)
G1 X50 Y35
...
D. ELECTRON 347
Chapter 12 Tool Radius Compensation CNC Z32 Programming Manual
The QF must be programmed accurately because if it is incorrect (in figure is 0 instead 54.46)
the tool could go into the profile.
These problems can be overcome with the other two following methods of connection to profile.
....
T2 M6 (RADIUS=10)
G0 X0 Y0
G41 X25 Y0
G1 X50 Y35
...
A fictitious segment of xx profile is added which takes the tool to start point of P1 profile: the tool
does not go into real profile but stops on the bisector of P1 corner.
......
T1 M6 (RADIUS 10)
G0 X0 Y0
G41 QF0
G1 X25 Y0
G1 X50 Y35
...
G41/G42 - X... Y... I J programmed - linear approach along the orthogonal to the profile
In case of closed profiles, and if the circular profile approach (G41/G42 X Y QF) is not desired, it
is necessary to program twice (beginning and end) a profile segment with a length at least the same
as the tool radius, otherwise a mark is left on the finished profile.
348
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 - Tool Radius Compensation
D. ELECTRON 349
Chapter 12 Tool Radius Compensation CNC Z32 Programming Manual
350
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 - Tool Radius Compensation
D. ELECTRON 351
Chapter 12 Tool Radius Compensation CNC Z32 Programming Manual
352
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
CHAPTER 13
D. ELECTRON 353
Chapter 13 - Special Performances CNC Z32 Programming Manual
If the machine goes back more than 1,5 mm from the first contact point on point 4 (forward
search with very slow movement), the alarm CN0613 is issued.
The parameters returned after a measuring cycle are:
AM contact position of first axis of the triad (defined with G25...)
BM contact position second axis
CM contact position third.
AM BM CM parameters are calculated starting from the positions measured at the moment of
contact referred to the active origin and taking into account the physical dimensions of the tracing
head.
If in phases 2 or 4 the contact is not found in the maximum path programmed, the CNC does not
give an error message but returns three very large parameters AM, BM, CM (more than 100.000):
this allows the operator to take decisions and change the program in the event of failure to make
contact.
N.B. In the event of failure to make contact, all three parameters are returned regardless of the
number of axes involved in the measuring movement.
The parameters to correct the positions with physical dimensions of the tracing head are:
L length
AP, AN, BP, BN radius
The equivalent tracing head composed of four ellipse arcs is represented in the following figure.
The CNC calculates on its own which parameter to use and with which direction coefficient, in
accordance with the inclination of the programmed tract.
354
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
It should be remembered that, if the braking distance from traverse to slow is greater than the
distance AB, the whole search (including the segment programmed as traverse) is performed a
slow search feedrate.
Generally the deceleration from traverse to slow can be executed completely or in part at slow
feedrate if the traverse is not completely reached.
In block search procedure G61 is ignored: the block is transformed into a movement block up to
the end positions. The parameters AM BM CM are not modified.
To restart the program without problems, even during block search, the programmer must save
in permanent memory (e.g. in the parameter section) the results of the various measurements in
order to be able to simulate the same in block search.
Active mode before G61 Mode during normal G61 (w/o J) Mode during G61 with
programmed J
D. ELECTRON 355
Chapter 13 - Special Performances CNC Z32 Programming Manual
WARNING
The maximum search speeds permitted during G61 with J programming
are very high (up to 6000 mm/min). The user must check that the braking
spaces consequent to programmed speed are compatible with the over-
stroke permitted by the measurement probe used.
Remember that the measurement bit is controlled by Z32 every 2 millisec, so that there is a
measurement uncertainty which depends on the search speed, as shown in the following table:
Input parameters:
HR ball radius
R presumed probe radius
L presumed probe length
1mm max error allowed.
356
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
PROGRAM %
AN0 AP0 BN0 BP0 (PRESET TO ZERO)
G0 AC<HR+1> (THIRD AXIS MEASURING)
AA0 AB0 (L MEASURING)
G61 AC<HR-1> DM2
!IF AM.99000;GON9! (ALARM IF CONTACT NDT FOUND)
L<L+CM-HR> (NEW L CALCULATING AND ACTIVATION)
(AN MEASURE)
G0 AA<HR+R+1> (EXIT MOVEMENT)
AC<-R> (DOWN MOVEMENT)
G61 AA<HR+R-1> (MEASURING)
!IF AM>99000; GON9! AN=AM-HR!
G0 AA<HR+R+1>
(AP MEASURING)
G0 AC<HR+1>
AA<-HR-R-1>
AC<-R>
G61 AA<-HR-R+1>
!IF AM>99000; G0N9! AP=-AM+HR!
G0 AA<-HR-R-1>
(BN MEASURING)
G0 AC<HR+1>
AA0 AB<HR+R+1>
AC<-R>
G61 AB<HR+R-1>
!IF AM>99000; GON9! BN=BM-HR!
G0 AB<HR+R+1>
(BP MEASURING)
G0 AC<HR+1>
AB<-HR-R-1>
AC<-R>
G61 AB<-HR-R+1>
!IF AM>99000; GON9! BP=-(BM+HR)!
G0 AB<-HR-R-1>
(AC EXIT MOVEMENT)
AC<HR+1>
(NEW TOOL CORRECTORS WRITING ON SPINDLE)
!:WSL=L,AN=AN,BN=BN,AP=AP,BP=BP!
G26 (END)
(ERROR MESSAGE)
N9 NO CONTACT
D. ELECTRON 357
Chapter 13 - Special Performances CNC Z32 Programming Manual
Please note how the signs in the AN, AP, BN and BP calculus were chosen because these four
parameters are positive and almost equal to the probe radius if probe is well centred.
PROGRAM
%
G0 X0 Y0 (X AND Y POSITIONING AND DOWN MOVEMENT OF Z)
Z<HA>
G61 X<HR-AP+HT> DM<2*HT> (X MEASURING)
!IF AM>99000; GON9! DI=AM!
G0 X0 (EXIT)
G61 X<-HR+AN-HT>
!IF AM>99000; GON9! DI=(DI+AM)/2!
G0 X<DI> (Y MEASURING)
G61 Y<HR-BP+HT>
!IF AM>99000; GON9! DJ=BM!
G0 Y0
G61 Y<-HR+BN-HT>
!IF AM>99000; GON9! DJ=(DJ+BM)/2!
!:ROX*=AM;AM=AM+DI;:WOX*=AM! (ORIGIN UPDATING)
!:ROY*=BM;BM=BM+DJ;:WOY*=BM!
G0 X0 Y0 (EXIT MOVEMENT)
Z<HC>
G26
(ERROR MESSAGE)
G9 NO CONTACT
Note the indirect addressing of origin in progress with character "*"
Also note the two traverse segments between the two X measurements and the two Y
measurements. In fact the probe is in contact with the piece after a G61: if another G61 is repeated
immediately without removing the probe there could be a CN0513 error.
358
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
D. ELECTRON 359
Chapter 13 - Special Performances CNC Z32 Programming Manual
The movements that are programmed next start from the interruption point instead of starting
from the programmed end of the interrupted movement. At the end of movement three parameters
are returned (as for measuring movements G61): AM, BM and CM with the following meanings:
(AM = BM = CM) = 0 if movement has been interrupted
(AM = BM = CM) > 100000 if movement has been completed
The aim of this G function is to create programs that can adapt in some way to situations taking
place during movement.
For example, let us imagine that, during machining (drill, mill etc) you have a device that can
detect excessive tool wear and tool breakage. By means of G62 a system can be arranged which
allows immediate interruption of machining and restart after the tool has been changed.
The system is composed of:
A) Measuring device (mounted on machine) which checks tool conditions (tool break or tool
wear)
B) Management in PLC (made by machine manufacturer) of stop signal and of logic bit 0EC.
C) Part-program (preferably canned cycle) containing G62 in all movement blocks, which
must be checked, with instructions for managing the return parameter (AM, BM, CM).
Example of part-program:
N10 T45 M6 (CUTTER)
N20 G0 X0 Y0 Z0 F400 M3 M7
N30 G1 Z-30 (UNCONTROLLED MOVEMENT)
N40 G62 X100 (MOVEMENT IN G1 WITH TOOL CONTROL)
N50 !IF AM>99000 EB! GON 100!
N60 ... (MACHINE IS GOING ON)
...
N100 ... (CONTROL OF WORN-OUT TOOL)
...
Whenever an interruption occurs, Z32 acquires the intermediate positions as initial positions of
the next movement. These positions can be slightly different from the programmed positions for the
zero-offsets of the axes.
For example:
...
N10 G0 X0 Y0 Z0
N20 G62 G1 Z-100
N30 Z0
...
Line 30 takes the Z axis to 0 in any case (with or without interruption).
If there is an offset of +0,01 mm on X axis and the movement is interrupted, the X position on its
way back can be up to +0,02 mm (it starts from the previous offset position and adds again an
offset).
At the contrary if the following is programmed:
...
N30 X0 Y0 Z0
...
The return is made without doubling zero-off position.
360
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
It should be noted that, even if the movement is interrupted and the positions at the moment of
the interruption are acquired, the parameter identified by the axis name keeps the final programmed
value.
Let us consider these two examples:
... ...
N10 G1 X0 Y0 Z0 N10 G1 X0 Y0 Z0
N20 G62 Z-100 N20 G62 Z-100
N30 X-50 N30 Z<Z> X-50
... ...
(example 1) (example 2)
Two programs differ only in the N30 line: when there is an interruption for example at position
Z=47,53 mm, in the first example N30 generates a movement parallel to axis X with Z=47,53 mm
constant position, and in the second example N30 generates a due axes movement up to the end
positions X-50 Z-100 (Z parameter keeps the programmed position -100).
G62 can be programmed also in G2 or in G3 movements, but it cannot be programmed either
for composite movements or in radius compensation.
The feedrate is taken to zero with controlled deceleration ramp and with axes in path (as with
FEED HOLD), when the control stop (0EC bit) is activated during G62 movement.
After the axes stop we move to the next program line. If before the stop the stop control ceases
(i.e. the 0EC bit returns to 0) the movement will start again with acceleration ramp up to the
programmed feedrate. In the programmable logic this characteristic (e.g. memorizing 0EC) must be
taken into account to avoid any oscillations (a worn tool sensor could stop detecting defects if the
feedrate drops to zero).
D. ELECTRON 361
Chapter 13 - Special Performances CNC Z32 Programming Manual
piece counting
tool life management
random place management
...
The reference to an origin in an ISO line (e.g. OX1) may not be repeatable if the origin itself is
modified by the program.
13.3.3 G61 Measuring movements and G62 working movements with stop
The measuring result can influence the evolution of the program in many ways:
piece identification and choice of sub-program
stock value and choice of cuts or tool number
...
Analogously G62 working movements with stop.
The axes movements are generally excluded in block search procedure: so the measuring or
the control of logic bits cannot be done in a movement with stop. So the results are not significant.
It should be noted that executing measuring movements during block search, apart from being
extremely complex (e.g. when should the tracer head be mounted or put away?), does not solve the
general problem. For example, if the tracer head is used to measure the stock, the mere fact that a
part of the machining has been executed changes the result.
362
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
D. ELECTRON 363
Chapter 13 - Special Performances CNC Z32 Programming Manual
because parameter C is not cyclic, and therefore after a time there will be problems due to
excessive number on the C parameter.
The correct way of programming an indefinite movement involves preventing parameter C from
indefinitely increasing, for example:
N1 C<C+179>
!IF C>360;C=C-360!
!GON1!
364
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
WARNING:
A cyclical continuous axes positioned using the shortest route could also
be used for circular interpolation but correct dimension (that should take
into account the revs accumulated) of the centre would be very difficult to
find. Basically, we can say that a cyclical continuous axis positioned using
the shortest route cannot be used for circular interpolation.
13.4.6 Programming cyclical axes through the shortest route with direction
In the machine settings of Z32, we can decide to program the motions of cyclical axes to reach
final position by the shortest route.
To assure compatibility with existing CAM software, another option was introduced to prevent
the motion from exceeding one revolution in any case but allows the direction of movement to
be chosen.
When this option is enabled, it forces the programmed character to a non-standard meaning.
The sign does not indicate a negative dimension any longer, but the direction of the motion.
Furthermore, the axis dimension is always deemed positive, from zero to the cycle value.
For example, if the B axis is cyclical, and if the positioning option for cyclical axes by the shortest
route with direction is enabled:
B-10
the B axes must be positioned on + 10, with negative direction of movement.
If the previously programmed dimension is confirmed (either by a positive or by a negative sign),
no movement occurs.
WARNING:
Forcing the meaning of the sign and the generation of the movements
implies some exceptions to the normal behaviour of Z32:
1) Since the meaning of the programmed sign is different from that of the arithmetical sign, the
programmed B parameter is forced to its absolute value. Therefore, after programming B-
10, the arithmetical content of the B parameter is no longer -10 but +10.
2) Using an expression (for instance B<HA-1>) to program B assigns an absolute value to
B and invalidates the negative sign. To maintain compatibility with possible future
modifications, we suggest not to program cyclical axes featuring direction selection by
means of such expressions.
3) As in the case of normal cyclical axes, disabled axes (ex. G29B) are not enabled during
movement if the programmed position is close to the current one and within the
positioning threshold. However, this means that a movement may not be made equal to
almost a complete revolution, if a position is programmed within the positioning
threshold, but with specification of a movement with an opposite sign. To assure
correct functioning, we suggest not to program cyclical axes featuring direction
selection when these are disabled.
4) A cyclical axis featuring specific positioning by the shortest route must belong to the
working triad. Z32 does not prompt any alarm, but in this case, the programmed
direction is likely to be ignored.
D. ELECTRON 365
Chapter 13 - Special Performances CNC Z32 Programming Manual
The dimensions (program TERMS) of the continuous linear axes (in inches) are
displayed with 2 integers and 5 decimals up to 99.99999, with 3 integers and 4 decimals
up to 999.9999 and with 4 integers and 3 decimals with higher dimensions. The rotary
axes maintain the previous display mode.
The set Feed is read in displayed units per minute and therefore in inches per minute as
regards linear axes and in degrees per minute for the rotary axes (unless different
calibration has been set).
The parameters in an evolved line field: W... contain up to five decimals. However, the
limit of six integers for a total of nine significant digits remains. For example, results may
be 1234, 56789 or 12345.6789. The maximum usable number is 999999.999; if the
number is higher, it is limited however to 999999.999.
If the machine is in inch mode:
copying (G111) does not work
macros (G110) do not work
These functions can be enabled on request at a later time.
366
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
D. ELECTRON 367
Chapter 13 - Special Performances CNC Z32 Programming Manual
3) Once the axis specified in point 2) has been repositioned, the second axis not coinciding with
the tool axis is proposed for repositioning. Consider that the repositioning of this axis is executed in
the rotated reference system, according to the head angles.
4) Finally, the tool axis is proposed for repositioning. Consider that the repositioning of this axis
is executed in the rotated reference system, according to the head angles. This latter movement
allows to go deep in the slanted groove.
Notes:
- This kind of special repositioning operates only with part-programs with G117 active in the
interruption point, otherwise a normal repositioning is executed.
- The logic signal enabling this feature is tested on entering the automatic activity, after the
execution of a block search: the system will execute the repositioning according the signal status at
the beginning of the automatic activity: if the status changes during the repositioning activity, this
has no effect on the kind of repositioning under execution. To change the kind of repositioning, the
automatic activity must be left (ESC pushbutton) and the entered again with the enable signal in the
proper state: this allow to change the kind of repositioning.
368
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
D. ELECTRON 369
Chapter 13 - Special Performances CNC Z32 Programming Manual
370
D. ELECTRON
CNC Z32 Programming Manual Chapter 14 - Obsolete features
CHAPTER 14
D. ELECTRON 371
Chapter 14 - Obsolete features CNC Z32 Programming Manual
Dont G98 temporarily disables G0, G1, G2, G3, i.e. all positions programmed after G98, are always
operate interpreted as end positions of a linear segment, like in G1. G99 restores the situation existing
before G98.
During G98, the following is also suspended:
rototranslation
mirroring
scale factor
When G98 is active, the programming of addresses I, J, QF, RA on a ISO line is allowed. In this
case however I, J, QF, RA dont assume any special meaning as profile elements, but they are valid
only as parameters. When G98 is active, the programming of I30 on a ISO line is equivalent to
!I=30! on an evolved line.
The above discussion pinpoints that a big quantity of operations normally executed by Z32 are
avoided when G98 is active, based on the consideration that these control functions have been
executed by the computer generating the profile (radius correction, programmed positions
computations, geometrical computations). The possibility to execute evolved lines (and therefore
mathematical computations) allows to restore, under control of the programmer, at least a portion of
the features disabled.
372
D. ELECTRON
CNC Z32 Programming Manual Chapter 14 - Obsolete features
D. ELECTRON 373
Chapter 14 - Obsolete features CNC Z32 Programming Manual
The velocity reference is integrated on each axis for a certain time (an integration cycle lasts 384
ms), and the corresponding theoretical axis displacement is computed.
The computed displacement is compared with the measured displacement and the error is
computed.
The allowed tolerance is computed by adding a series of components: 1/16 of actual velocity,
plus 1/256 of the rapid, plus a mm/min speed equal to the positioning error multiplied by 5000. For
example, if an axis is moving with a velocity of 4000 mm/min, the axis rapid is 20 m/min and the
positioning error is 0,015, the allowed velocity error is 4000/16 + 20000/256 + 0,015*5000 = 250 +
78,1 + 75 = 403,1 mm/min. In 0,384 seconds the maximum error accumulated by the axis may be
2.58 mm. If greater, the alarm is triggered.
Once the axis has be found behaving not correctly, the error is signaled to the machine logic,
and, if the failing axis is an alive axis controlled by part-program, the alarm CNDx13 is issued,
where x is the logical number of the failing axis.
This kind of control is useful also in case a position detector is blocked in a condition not
detected by the interface board, thus avoiding the issuing of error CNxx12.
The efficiency of this control may result not compatible on machines with rough axes; the control
may be disabled in machine setup.
374
D. ELECTRON
CNC Z32 Programming Manual Chapter 14 - Obsolete features
14.1.5 Examples
As G98 usage examples, two programs for the execution of an ellipse are show: with and
without radius correction.
The ellipse parametric equations are:
X = HA * cos HT Y = HB * sen HT
where HA and HB are the semiaxes in X and Y directions respectively, and HT is the angular
parameter which, incremented from 0 to 360 degrees, produces the desired coordinates.
The ellipse parametric equations with radius correction are:
HC = HA * sen HT
HD = HB * cos HT
X = HA * cos HT + R * HD / rquad (HC2 + HD2)
Y = HB * sen HT + R * HC / rquad (HC2 + HD2)
where HA and HB are the semiaxes, HT is the angular parameter ranging from 0 to 360, R is the
tool radius, HC and HD are two intermediate parameters used to shorten the computation.
D. ELECTRON 375
Chapter 14 - Obsolete features CNC Z32 Programming Manual
The programmer may note that instructions from N7 to N10, completely parameterized, may be
used to execute any ellipse.
With a positive tool radius R, the correction is made on the outside of the ellipse, if R is negative,
the correction is made in the internal side: in this latter case, the programmer must be certain that
the R value is not greater than the minimum curvature radius of the ellipse (i.e. the tool is
sufficiently small to contour all the ellipse from the internal side), otherwise, with this simple
program, the tool enters in the profile.
If an ellipse in the space, placed on a plane slanted around Y axis, it is sufficient to insert also
the computation of Z point, in the movement block computing also the ellipse point, for example:
X<...> Y<...> Z<HG * X>
where HG is the slant.
376
D. ELECTRON