You are on page 1of 388

D.

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.

D. Electron - Via R. Giuliani 140 - 50141 Florence ITALY internet: www.delectron.it


Tel ++39 055 416927 r.a. Fax ++39 055 434220 e-mail: delectron@delectron.it
Contents CNC Z32 Programming Manual

CONTENTS

1. FILES ORGANIZATION AND STRUCTURE....................................................................... 1

1.1 INTRODUCTION ..............................................................................................................................................................1

1.2 GENERAL REMARKS .....................................................................................................................................................1


1.2.1 Files organization .........................................................................................................................................................2
1.2.2 Files organization on the hard disk ...............................................................................................................................3
1.2.3 Part-program.................................................................................................................................................................3
1.2.4 Optional block ..............................................................................................................................................................5
1.2.5 Double barred block .....................................................................................................................................................6
1.2.6 Program sectioning .......................................................................................................................................................6

1.3 ISO LINES ..........................................................................................................................................................................8


1.3.1 Line linking...................................................................................................................................................................8
1.3.2 Line number..................................................................................................................................................................9
1.3.3 Elementary instructions, addresses & numerical values ...............................................................................................9
1.3.4 Comment lines ............................................................................................................................................................11

2. PREPARATORY G FUNCTIONS ...................................................................................... 13

2.1 G FUNCTIONS ................................................................................................................................................................13


2.1.1 G0 - traverse positioning ............................................................................................................................................13
2.1.2 G1 - working linear movement ...................................................................................................................................14
2.1.3 G2 - clockwise circular interpolation..........................................................................................................................15
2.1.4 G3 - counter-clockwise circular interpolation ............................................................................................................15
2.1.5 G4 - dwell ...................................................................................................................................................................15
2.1.6 G6.2 - NURBS control ...............................................................................................................................................16
2.1.7 G10 - rough fast positioning (obsolete) ......................................................................................................................17
2.1.8 G12 - third axis coordination on.................................................................................................................................18
2.1.9 G13 - helical Interpolation off ....................................................................................................................................20
2.1.10 G16 - re-direction of axes .......................................................................................................................................20
2.1.11 G25 - choice of machining triad .............................................................................................................................21
2.1.12 G26 - end of subprogram........................................................................................................................................23
2.1.13 G27 - canned cycle and permanent subprogram .....................................................................................................23
2.1.14 G28 - axis activation...............................................................................................................................................23
2.1.15 G29 - axis deactivation ...........................................................................................................................................25
2.1.16 G30 - G31 - circle incremental programming.........................................................................................................26
2.1.17 G33 - thread cutting................................................................................................................................................26
2.1.18 G34 - G35 - variable pitch threading ......................................................................................................................28
2.1.19 G36 - progressive number management .................................................................................................................30
2.1.20 G37 - local/global files commutation......................................................................................................................31
2.1.21 G38 - tool changer on .............................................................................................................................................33
2.1.22 G39 - tool changer off ............................................................................................................................................33
2.1.23 G40 - radius compensation off................................................................................................................................33
2.1.24 G41 - radius compensation, tool on the left ............................................................................................................33
2.1.25 G42 - radius compensation, tool on the right..........................................................................................................33
2.1.26 G43 - positive tool length compensation ................................................................................................................34
2.1.27 G44 - negative tool length compensation ...............................................................................................................34
2.1.28 G45 - tool length compensation off ........................................................................................................................34
2.1.29 G53 - origin and length compensation off ..............................................................................................................35
2.1.30 G54 - origin and length compensation on...............................................................................................................35
2.1.31 G55 - mirroring off .................................................................................................................................................36

D. ELECTRON i
CNC Z32 Programming Manual Contents

2.1.32 G56 - mirroring on .................................................................................................................................................36


2.1.33 G61 - measuring movement....................................................................................................................................36
2.1.34 G62 - working movement with PLC stop ...............................................................................................................36
2.1.35 G63 - synchronized tapping....................................................................................................................................36
2.1.36 G70 - G71 - millimeter/inches programming .........................................................................................................38
2.1.37 G80 - tapping off ....................................................................................................................................................41
2.1.38 G84 - tapping on.....................................................................................................................................................41
2.1.39 G90 - programming absolute axis positions on ......................................................................................................42
2.1.40 G91 - programming incremental axis positions on.................................................................................................42
2.1.41 G93 - feed programming as inverse time................................................................................................................44
2.1.42 G94 - feed in mm/minute........................................................................................................................................45
2.1.43 G95 - feed in mm/revolution ..................................................................................................................................45
2.1.44 G96 - constant cutting speed in m/min ...................................................................................................................46
2.1.45 G97 - spindle in r.p.m.............................................................................................................................................47
2.1.46 G98 - special linear interpolation (obsolete) ..........................................................................................................47
2.1.47 G99 - G98 interpolation off (obsolete)...................................................................................................................47
2.1.48 G100 - data from part-program to PLC ..................................................................................................................47
2.1.49 G101 - data from PLC to part-program..................................................................................................................48
2.1.50 G102 - store current status......................................................................................................................................48
2.1.51 G103 - restore status...............................................................................................................................................49
2.1.52 G104 - read active tool...........................................................................................................................................50
2.1.53 G105 - read current axes position...........................................................................................................................50
2.1.54 G106 - radial programming ....................................................................................................................................51
2.1.55 G107 - diameter programming ...............................................................................................................................51
2.1.56 G108 - acceleration and feedrate limits..................................................................................................................52
2.1.57 G109 - personalization of radius compensation .....................................................................................................52
2.1.58 G110 - rough-machining macrofunctions...............................................................................................................55
2.1.59 G111 - special tracing movements .........................................................................................................................63
2.1.60 G112 - synchronization with ML logic...................................................................................................................64
2.1.61 G113H - G113L - 2-millisecond interpolation .......................................................................................................64
2.1.62 G113P - G113F - G113X choosing between proportional, feed-forward and X MODE movement......................64
2.1.63 G113X KA1 - interpolation evolution in X MODE ...............................................................................................66
2.1.64 G113X KA2 - better X MODE speed/acceleration management ...........................................................................66
2.1.65 G113C - G113N - compensating tool paths for soft movements............................................................................66
2.1.66 G113A - G113B - G113Z - rounding off ...............................................................................................................66
2.1.67 G113V - G113S - advanced feed management ......................................................................................................67
2.1.68 G114 - high-speed machining.................................................................................................................................67
2.1.69 G115 - disable high-speed machining ....................................................................................................................69
2.1.70 G116 - machining on an inclined plane..................................................................................................................69
2.1.71 G117 - RTCP for rotary head .................................................................................................................................71
2.1.72 G118 - RTCP for rotary table.................................................................................................................................71
2.1.73 G118 HR1 - RTCP for rotary table with combined linear/rotary motions..............................................................71
2.1.74 G118 HR2 - static RTCP for turning table .............................................................................................................72
2.1.75 G118S - static RTCP with turning table axis position programming .....................................................................72
2.1.76 G119 - MDI and jog mode with position transducer alarms ..................................................................................73
2.1.77 G120 - rotary table RTCP coordinates of the table centre......................................................................................73
2.1.78 G121 - differentiated scale factors by areas ...........................................................................................................73
2.1.79 G122 - compensation of piece assembly error on tilting tables..............................................................................73
2.1.80 G123 - limit capacity range ....................................................................................................................................74
2.1.81 G124 - enable rotary axes handwheels in G117 .....................................................................................................77
2.1.82 G125 - G125 KA1 - G125 KA101 - axis calibration for high-speed tasks.............................................................79
2.1.83 G126 - enable machining of a workpiece in motion...............................................................................................79
2.1.84 G127 - disable machining of a workpiece in motion ..............................................................................................79
2.1.85 G128 - G129 - G130 process lock functions ..........................................................................................................79
2.1.86 G131 - constant speed of tool tip............................................................................................................................80
2.1.87 G132 KA1 - globoidal cams machining .................................................................................................................81
2.1.88 G132 KA2 - cylindrical cams machining ...............................................................................................................82

ii
D. ELECTRON
Contents CNC Z32 Programming Manual

2.1.89 G132 KA3 - polar cams machining ........................................................................................................................84


2.1.90 G133 KA0 KA5 - double spindle and table-spindle management.......................................................................86
2.1.91 G134 KA0 KA3 - milling machine/lathe machine switching ..............................................................................87
2.1.92 G135 I1 - G135 J1 - advanced management of high speed ....................................................................................89
2.1.93 G136 - microdwell..................................................................................................................................................90
2.1.94 G137 - G138 - for single block and block search ...................................................................................................91
2.1.95 G139 - concurrent axes...........................................................................................................................................91
2.1.96 G141 - G140 - three-dimensional correction of tool radius....................................................................................93
2.1.97 G142 - G143 - tool retraction (RETRACT) ...........................................................................................................94
2.1.98 G144 - part-program suspension and JOG or handwheel activation.......................................................................97
2.1.99 G144 KA1 - part-program suspension and JOG activity activation........................................................................97
2.1.100 G145 - stop and go .................................................................................................................................................98
2.1.101 G146 - height control management.........................................................................................................................98
2.1.102 G147 - G148 - movement velocity control .............................................................................................................99
2.1.103 G149 - cylindrical axes management....................................................................................................................103
2.1.104 G150 - radius correction for lathes .......................................................................................................................105
2.1.105 G151 - spindle rough positioning .........................................................................................................................106
2.1.106 G152 KA1 - G153 KA1 - save/restore of active origins.......................................................................................107
2.1.107 G154 - block search with length ...........................................................................................................................107
2.1.108 G155 - raster functionality ................................................................................................................................108
2.1.109 G156 - graphic display management for lathes.....................................................................................................111
2.1.110 G157 HX - for connection between part-program and fast-codos ........................................................................111
2.1.111 G158 - G159 - forcing of cyclic/non cyclic axis...................................................................................................112
2.1.112 G160 - to limit the axes and spindle speed ...........................................................................................................112
2.1.113 G161 - reserved for the simulator .........................................................................................................................113
2.1.114 G163 - synchronised tapping, with spindle position control.................................................................................113
2.1.115 G164 - compensation for a particular type of chatter ...........................................................................................114
2.1.116 G200 HX0 / G200 HX1 - DNC mode setting.......................................................................................................115
2.1.117 G200 HX2 / G200 HX3 - inversion kick deactivation..........................................................................................115
2.1.118 G200 HX4 / G200 HX5 - complete circle programming......................................................................................115
2.1.119 G200 HX6 / G200 HX7 - low search feed change in G61....................................................................................116
2.1.120 G200 HX8 / G200 HX9 - rigid tapping without spindle inversion .......................................................................116
2.1.121 G200 HX10 - timed G113X KA1 enable .............................................................................................................117
2.1.122 G200 HX11 / G200 HX12 - precise G4 dwell mode under G113X .....................................................................117
2.1.123 G200 HX13 / G200 HX14 - for backward compatibility with Z16 ......................................................................118
2.1.124 G200 HX15 / G200 HX16 - eliminates the apparent RA increase for small-diameter circles..............................118
2.1.125 G200 HX17 / G200 HX18 - circle programming tolerance..................................................................................119
2.1.126 G201 - dynamic structure behavior analysis .........................................................................................................119
2.1.127 G241 - G242 - positioning on the initial point of future radius correction ...........................................................119
2.1.128 G410 - G420 - lathe tool anti-gouge floating........................................................................................................121
2.1.129 G800 - G801 - G802 - on-disk canned cycles and macros....................................................................................123
2.1.130 G880G899 - G900 G999 - on-disk canned cycles and macros.........................................................................129

3. M FUNCTIONS - FEED - SPEED - ORIGINS - PARAMETERS ...................................... 133

3.1 AUXILIARY M FUNCTIONS ...................................................................................................................................133


3.1.1 M ISO ...................................................................................................................................................................133
3.1.2 Special MS...........................................................................................................................................................134

3.2 AUXILIARY MA, MB, MC FUNCTIONS..................................................................................................................135

3.3 FEED ...............................................................................................................................................................................135

3.4 SPEED .............................................................................................................................................................................136

3.5 AXES DIMENSIONS.....................................................................................................................................................136

D. ELECTRON iii
CNC Z32 Programming Manual Contents

3.6 AXES WITH TWO LETTERS NAMES (NUMERIC INDEX).................................................................................137

3.7 ORIGINS AND LENGTHS...........................................................................................................................................138


3.7.1 Origins......................................................................................................................................................................139
3.7.2 Origin conditioned by its existence ..........................................................................................................................140
3.7.3 Origin offset .............................................................................................................................................................141
3.7.4 Single Origin ............................................................................................................................................................141
3.7.5 Tool length ...............................................................................................................................................................142
3.7.6 Origin and length management.................................................................................................................................142
3.7.7 DDL and DDR: tool length and radius modification................................................................................................143
3.7.8 DLX and DLZ for tool length modification (lathes) ................................................................................................143
3.7.9 LEF and REF actual value Length and tool Radius..................................................................................................144

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

4. TOOLS - EXECUTION OF ISO LINE............................................................................... 167

4.1 TOOL MANAGEMENT ('T', 'TA', 'TB') ...................................................................................................................167


4.1.1 Random management ...............................................................................................................................................169
4.1.2 Multipurpose tools and random management...........................................................................................................170
4.1.3 Tool life management...............................................................................................................................................171
4.1.4 Management of tool families....................................................................................................................................172

4.2 ISO LINE EXECUTION SEQUENCE ........................................................................................................................175

5. EVOLVED LINES - JUMPS - CONDITIONING - READ/WRITE...................................... 177

5.1 EVOLVED LINES .........................................................................................................................................................177


5.1.1 Parameter definition by expression computation......................................................................................................177
5.1.2 Cartesian/polar co-ordinate conversion and vice-versa ............................................................................................178

5.2 JUMPS ............................................................................................................................................................................178


5.2.1 Jump to a line without return....................................................................................................................................178
5.2.2 Jump to a series of lines with return .........................................................................................................................179

iv
D. ELECTRON
Contents CNC Z32 Programming Manual

5.2.3 Jumps to sub-programs .............................................................................................................................................182


5.2.4 Parameterization of jumps to lines and to sub-programs ..........................................................................................183
5.2.5 !GOP..-N..! and GOP..-N..-N..!................................................................................................................................184
5.2.6 Field G26, end of subprogram for DNC ...................................................................................................................184

5.3 CONDITIONING ...........................................................................................................................................................185

5.4 READING/WRITING IN PERMANENT MEMORY................................................................................................186


5.4.1 Multiple readings and writings .................................................................................................................................188
5.4.2 Operating origin........................................................................................................................................................188
5.4.3 Tool place.................................................................................................................................................................188
5.4.4 Reading/writing in block search procedure ..............................................................................................................189
5.4.5 :C and :S instructions (extension of :R and :W instructions) ....................................................................................189
5.4.6 :E instruction for origin deletion in CMOS ..............................................................................................................191

5.5 OTHER ...........................................................................................................................................................................191


5.5.1 Function :L to upload files from a disk.....................................................................................................................191
5.5.2 Function :L- to download files on disk .....................................................................................................................194
5.5.3 :L254 function multiple execution in DNC ..............................................................................................................194
5.5.4 Parametric programming of the filename executed in DNC .....................................................................................195
5.5.5 Structured DNC ........................................................................................................................................................196
5.5.6 :P instruction prints strings and parameter values to video.......................................................................................197
5.5.7 :D instruction prints strings and parameter values to video ......................................................................................198
5.5.8 :F instruction string writing to file ............................................................................................................................199
5.5.9 DOC files for block search with optional block .......................................................................................................200
5.5.10 INPUT instruction - Entering part-program parameters from the keyboard .........................................................202

6. STRUCTURED PROGRAMMING FUNCTIONS.............................................................. 205

6.1 STRUCTURED PROGRAMMING .............................................................................................................................205


6.1.1 IF - ELSEIF - ELSE - END IF structure...................................................................................................................205
6.1.2 DO - EXIT DO - LOOP structure.............................................................................................................................209
6.1.3 GOTO - LN structure ...............................................................................................................................................211
6.1.4 DEFINE - END DEFINE structure ..........................................................................................................................212
6.1.5 OUT instruction........................................................................................................................................................213
6.1.6 WAIT instruction......................................................................................................................................................214

6.2 Temporary subroutines..................................................................................................................................................215

7. Z32 FIXED CYCLES AND MACROS .............................................................................. 219

7.1 Z32 FIXED CYCLES (G800) ........................................................................................................................................219


7.1.1 G800K1: DRILLING ...............................................................................................................................................221
7.1.2 G800K2: DEEP DRILLING WITH CHIP BREAKAGE ........................................................................................222
7.1.3 G800K3: DEEP DRILLING WITH CHIP EXTRACTION.....................................................................................223
7.1.4 G800K4: TAPPING .................................................................................................................................................224
7.1.5 G802K5: REAMING................................................................................................................................................225
7.1.6 G800K6: BORING...................................................................................................................................................226
7.1.7 G802K7: DEEP DRILLING WITH CHIP BREAKAGE AND EXTRACTION.....................................................227
7.1.8 G800K8: TWO ZONES DRILLING WITH GAP ...................................................................................................228
7.1.9 G800K9: THREE ZONES DRILLING....................................................................................................................229
7.1.10 G800K10: INTERNAL SPIRAL MILLING-BORING........................................................................................231
7.1.11 G800K11: EXTERNAL SPIRAL MILLING-BORING ......................................................................................232

7.2 Z32 POSITIONING MACROS (G801) ........................................................................................................................233

D. ELECTRON v
CNC Z32 Programming Manual Contents

7.2.1 G801K1: LINE - STARTING POINT AND INCREMENTS .................................................................................235


7.2.2 G801K2: LINE - STARTING POINT, ANGLE AND POINT DISTANCE...........................................................235
7.2.3 G801K3: LINE - STARTING AND END POINT ..................................................................................................236
7.2.4 G801K4: GRID - ROW AND COLUMN INCREMENTS......................................................................................237
7.2.5 G801K5: GRID - STARTING POINT, DISTANCES AND ANGLES...................................................................237
7.2.6 G801K6: GRID - ROW AND COLUMN STARTING AND END POINTS..........................................................238
7.2.7 G801K7: CIRCLE - INITIAL ANGLE AND TOTAL INCREMENT ....................................................................239
7.2.8 G801K8: CIRCLE - INITIAL ANGLE AND ANGULAR DISTANCE .................................................................240
7.2.9 G801K9: CIRCLE - INITIAL AND FINAL ANGLE .............................................................................................241
7.2.10 G801K10: RECTANGLE - CENTER AND PITCH ...........................................................................................242
7.2.11 G801K11: RECTANGLE - CENTER AND SIDES ............................................................................................242
7.2.12 G801K12: RECTANGLE - CORNER AND PITCH...........................................................................................243
7.2.13 G801K13: RECTANGLE - CORNER AND SIDES ...........................................................................................244

7.3 Z32 MACHINING MACROS (G802) ..........................................................................................................................245


7.3.1 G802K1: CIRCULAR POCKETS ROUGHING .....................................................................................................247
7.3.2 G802K2: RECTANGULAR POCKET ROUGHING - POCKET CENTER...........................................................249
7.3.3 G802K3: RECTANGULAR POCKET ROUGHING - CORNER ..........................................................................251
7.3.4 G802K4: CIRCULAR POCKETS FINISHING ......................................................................................................253
7.3.5 G802K5: RECTANGULAR POCKET FINISHING - POCKET CENTER............................................................255
7.3.6 G802K6: RECTANGULAR POCKET FINISHING - CORNER............................................................................257
7.3.7 G802K7: LINEAR EYELET ...................................................................................................................................259
7.3.8 G802K8: CIRCULAR EYELET - EYELET CENTER ...........................................................................................261
7.3.9 G802K9: CIRCULAR EYELET - CURVATURE CENTER ..................................................................................263
7.3.10 G802K10: HOLE THREAD MILLING WITH A SINGLE FLUTE END MILL ...............................................265
7.3.11 G802K11: HOLE THREAD MILLING WITH A COMB END MILL...............................................................266
7.3.12 G802K12: STUD THREAD MILLING WITH A SINGLE FLUTE END MILL ...............................................267
7.3.13 G802K13: STUD THREAD MILLING WITH A COMB END MILL ...............................................................268
7.3.14 G802K14: FACE MILLING ................................................................................................................................269

7.4 EXAMPLES ...................................................................................................................................................................270

8. MACHINE TOOL BUILDER AND USER CANNED CYCLES AND PERMANENT


SUB-PROGRAMS ....................................................................................................................... 275

8.1 CANNED CYCLES........................................................................................................................................................275


8.1.1 Example of Drill.......................................................................................................................................................276
8.1.2 Example of Drill with Dwell ....................................................................................................................................276
8.1.3 Example of Deep hole ..............................................................................................................................................277
8.1.4 Example of Tapping .................................................................................................................................................277
8.1.5 Example of Boring with working reversal................................................................................................................278
8.1.6 Example of Boring with spindle stop .......................................................................................................................278
8.1.7 Example of Boring with indexed spindle reversal....................................................................................................279
8.1.8 Example of Internal milling......................................................................................................................................279
8.1.9 Example of Drill with working forward/reversal and stop at hole end .....................................................................280

8.2 PERMANENT SUB-PROGRAMS...............................................................................................................................280


8.2.1 Example 1 - Toothed line with two tooth types........................................................................................................281
8.2.2 Example 2 - Program in XY for polar coordinates machine ....................................................................................282

9. PERMANENT FORMULAE.............................................................................................. 285

9.1 GENERAL ......................................................................................................................................................................285


9.1.1 Permanent formulae content.....................................................................................................................................286
9.1.2 ISO line syntax with permanent formulae ................................................................................................................287

vi
D. ELECTRON
Contents CNC Z32 Programming Manual

9.1.3 Enabling Disabling Variation of permanent formulae ..............................................................................................287


9.1.4 Initial and final connections......................................................................................................................................288
9.1.5 Permanent formulae compilation..............................................................................................................................290
9.1.6 Execution time..........................................................................................................................................................291
9.1.7 End of travel control.................................................................................................................................................292
9.1.8 Maximum feed control .............................................................................................................................................292
9.1.9 Active Formulae and G53.........................................................................................................................................293
9.1.10 Applications..........................................................................................................................................................293

10. GEOMETRY.................................................................................................................. 295

10.1 GENERAL ..................................................................................................................................................................295

10.2 GEOMETRIC CONTOURS IN THE PLANE ........................................................................................................295


10.2.1 Geometric definitions ...........................................................................................................................................295
10.2.2 Elements defining a contour .................................................................................................................................296
10.2.3 Ways of Programming of contour segments .........................................................................................................299
10.2.4 Closed lines ..........................................................................................................................................................301
10.2.5 Open lines.............................................................................................................................................................302
10.2.6 Closed circles........................................................................................................................................................303
10.2.7 Open circles ..........................................................................................................................................................307
10.2.8 Line - circle combinations ....................................................................................................................................308
10.2.9 Complete circle programming ..............................................................................................................................310

10.3 CIRCULAR CONNECTIONS AND CHAMFERS.................................................................................................312


10.3.1 Automatic chamfers..............................................................................................................................................312
10.3.2 Automatic circular connections ............................................................................................................................314
10.3.3 Existence field of circular connections .................................................................................................................324

10.4 PROGRAMMING EXAMPLES...............................................................................................................................325


10.4.1 Formed plate 1......................................................................................................................................................325
10.4.2 Formed Plate 2......................................................................................................................................................327
10.4.3 Propeller with three blades ...................................................................................................................................329

10.5 CONTOURS ON THREE AXES ..............................................................................................................................330

10.6 FEEDRATE CONTROL ...........................................................................................................................................330


10.6.1 Initial acceleration ................................................................................................................................................330
10.6.2 Central constant feedrate ......................................................................................................................................330
10.6.3 End deceleration ...................................................................................................................................................331
10.6.4 Feedrate with G12 operating ................................................................................................................................331

11. ROTATION, TRASLATION, MIRRORING, SCALE FACTOR ...................................... 333

11.1 PROGRAMMED DIMENSIONS TRANSFORMATION .....................................................................................333

11.2 ROTATION ................................................................................................................................................................334


11.2.1 Axes movements and rotation...............................................................................................................................335

11.3 TRASLATION............................................................................................................................................................336
11.3.1 Axes movements and traslation ............................................................................................................................336

11.4 MIRRORING .............................................................................................................................................................337


11.4.1 Axes movements and mirroring ............................................................................................................................337

D. ELECTRON vii
CNC Z32 Programming Manual Contents

11.5 SCALE FACTOR.......................................................................................................................................................338

11.6 MODIFICATION PARAMETERS FOR DIMENSIONS......................................................................................338

12. TOOL RADIUS COMPENSATION................................................................................ 341

12.1 TOOL RADIUS COMPENSATION ........................................................................................................................341


12.1.1 Connection to profile............................................................................................................................................346
12.1.2 Detachment from the profile.................................................................................................................................349
12.1.3 Feedrate control....................................................................................................................................................350
12.1.4 Zero or negative radius.........................................................................................................................................350
12.1.5 Single block..........................................................................................................................................................351
12.1.6 Closed profiles in radius compensation mode ......................................................................................................351

13. SPECIAL PERFORMANCES........................................................................................ 353

13.1 MEASURING PROBE - G61....................................................................................................................................353


13.1.1 G61 measuring cycle with a single contact...........................................................................................................355
13.1.2 G61 KA1 measuring cycle on rototraslated planes ..............................................................................................356
13.1.3 Macro for probe calibration .................................................................................................................................356
13.1.4 Macro for zeroing of XY origins at the centre of hole .........................................................................................358
13.1.5 Block Search with measuring movements ............................................................................................................359

13.2 MOVEMENT WITH STOP BY PLC G62 ..............................................................................................................359

13.3 BLOCK SEARCH PROCEDURE WITH SPECIAL FUNCTIONS .....................................................................361


13.3.1 Data reading from CMOS memory ......................................................................................................................361
13.3.2 G101 Data from PLC to part-program .................................................................................................................362
13.3.3 G61 Measuring movements and G62 working movements with stop...................................................................362
13.3.4 Solving example ...................................................................................................................................................362

13.4 CYCLICAL CONTINUOUS AXES .........................................................................................................................363


13.4.1 Acquiring the initial point ....................................................................................................................................363
13.4.2 Programming more than one revolution ...............................................................................................................363
13.4.3 Acquiring a Dimension using G105 .....................................................................................................................364
13.4.4 Repositioning after a block search .......................................................................................................................364
13.4.5 Cyclical axes by the shortest route .......................................................................................................................364
13.4.6 Programming cyclical axes through the shortest route with direction ..................................................................365

13.5 MACHINE IN INCHES ............................................................................................................................................365

13.6 MACHINING OFFSETS DRIVEN BY JOG BUTTONS (OFFSETJOG) ...........................................................366

13.7 SPECIAL REPOSITIONING IN RTCP ..................................................................................................................367

13.8 DISCRETE AXES......................................................................................................................................................368

14. OBSOLETE FEATURES .............................................................................................. 371

14.1 G98 SPECIAL LINEAR INTERPOLATION (5 AXES) ........................................................................................371


14.1.1 Following error.....................................................................................................................................................372
14.1.2 Second acceleration management.........................................................................................................................374
14.1.3 G99 and maximum velocity..................................................................................................................................374
14.1.4 Practical considerations........................................................................................................................................375

viii
D. ELECTRON
Contents CNC Z32 Programming Manual

14.1.5 Examples ..............................................................................................................................................................375

D. ELECTRON ix
CNC Z32 Programming Manual Chapter 1 - Files organization and structures

CHAPTER 1

1. FILES ORGANIZATION AND STRUCTURE

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.

1.2 GENERAL REMARKS


The Z32 is a 32 bit CNC for machining centres, lathes, milling and copy-milling machines, etc.,
with exceptional multiprocessing characteristics.
It was designed to also support FMS and tool machines that carry out simultaneous and
independent machining.
The Z32 is fully compatible at part-program level with its predecessor Z16; a Z16 program runs
without problems on Z32. However, maximum attention must be used for the first execution, as if
the program were new.
The Z32 is a multiprocessing CNC (but not a multiprocessor!) which means it can
simultaneously control several machining processes (or even several machines, which can be
synchronized through the programmable logic).
In practice the Z32 contains several complete numerical controls, each connected to a particular
group of axes, even complete with spindle.
There are no compulsory connections between the part-program and the process, the only
constraint that the part-program must be adapted to the process where it is executed.
This manual provides the necessary technical information for the correct programming of the
Z32 applied to lathes and machining centres.
The Z32 performs the following main tasks:
read and display axes positions
axes control
PLC management
Interface to the operator and carry out operating programs

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.

1.2.1 Files organization


When the Z32 is turned on it loads during the initialization phase in the RAM memory from the
hard disk:
the Z32 operating system
the start up files, machine logic and settings
The Z32 is equipped with a retentive memory (CMOS) of about 390 KBytes, with battery backup.
In a Z32, up to 6 processes may be present, numbered from 0 to 5. The CMOS memory of the
Z32 is shared between all processes.
The files present in the Z32 CMOS memory as part-programs, tables, macros, fixed cycles,
etc... may be accessed and called by each process.
Inside the CMOS memory, the files are designated with a number, comprised between 1 and
239.
The maximum length of a CMOS file cannot be higher than 64KB (characters).
Files between 1 and 109 are available to the user as part-programs, user fixed cycles,
subprograms, etc...
The tables of tools, origins and parameters are identified with numbers between 110 and 127.
CMOS files reserved to the machine tool builder are designated with numbers ranging from 128
to 239; this area cannot be accessed (may be accessed only in service mode).
Numbering of the tables in the various processes:

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).

Summary of files in memory


Accessible area:

1 - 109 Part-programs, subprograms. user cycles


110 - 112 Tables of parameters, origins, tools of process 5
113 - 115 " " " " " 4
116 - 118 " " " " " 3

2
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 - Files organization and structures

119 - 121 " " " " " 2


122 - 124 " " " " " 1
125 - 127 " " " " " 0
Protected area:

128 - 169 Special M functions or manufacturer subprograms


170 - 199 System canned cycles
200 - 231 Special M functions or manufacturer subprograms (as 128 to 169)
232 - 237 Process base-origins
238 - 239 Not assigned

1.2.2 Files organization on the hard disk


It is possible to store and organize the part-programs to be executed also on the hard disk. The
default folder used for this purpose is the folder C:\Z32\PPG. Every other folder present on the disk
may also be used.
Inside the folder C:\Z32\PPG (or any other folder chosen to store the part-programs) are
contained the machining files, which may be stored in subfolders.
No physical limit on the dimensions of a file (part-program) exist, nor for the total disk capacity
used for all files, the only limit being the available space on disk (normally many hundreds of
megabytes).
A part program name is a sequence of alfanumeric characters, letters. numbers and other
symbols, except the following, not allowed, characters: \ / : * ? < > |.

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...
...

Execution of part-program without initial %


The % character is considered as part-program start mark by the ISO standard
Z32 ignores all characters possibly contained in the part-program before the initial % character.
If the initial % is missing the part program is executed completely from the beginning.

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.

Note on the handling of not allowed characters


Some restriction exist, inhibiting the usage of some (ASCII) characters inside a part-program.
The Z32 CNC executes a syntax check, and the alarm CN1D14 PROGRAM ERROR is issued, if
not allowed characters are detected.
The protection logic follows these rules:
- control characters (with ASCII value < 32) are always forbidden and cause alarm
- extended characters (semi-graphic, with ASCII value >127 or lower case) are allowed in
comments, in the part-program header, in lines or parts of lines not executed (lines skipped with
GO or structured instructions, parts of advanced lines skipped with EB, etc.).
- lower case or extended characters (semi-graphic, with ASCII value >127) are accepted as
origin name.
WARNING
the display of semigraphic characters in some user interface programs
may be not correct, because characters values >127 were used for
inverted video signals by TERMS and in some cases also by ZTERM;
instead of the semigraphic character, a completely different character may
be displayed, possibly blinking or highlighted, etc. The user can chose if
this functionality reduction is acceptable and continue to use semigraphic
characters inside its part-programs.

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.

1.2.4 Optional block


If a program line starts with / the line itself is executed only if the relevant command (switch on
frontal panel) is entered.
Example:
/N28 X0 Y0
Axes moves to point 0,0 only if the optional blocks are enabled.
/N30 !GOP20!
The jump to subprogram P20 takes place only if the optional blocks are enabled.
The optional block can identify a jump: in this case it must be searched with the initial /.
Example:
N60!GO/N30!
The optional block command may not be immediately effective due to the presence in Z32 of a
buffer of pre-processed instructions that permit quicker execution.The choice of whether or not to
execute the optional block is made when the pre-processing takes place; therefore if the optional

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.

1.2.5 Double barred block


If a program line begins with two successive / characters (//) the line itself will be executed
only in block search procedure. This allows the programmer to establish the path to follow in block
search procedure and, if necessary, to skip entire series of operations.

1.2.6 Program sectioning


A line beginning with a : character indicates program sectioning. After the : a number that
indicates the section must be programmed.
Example:
...
:10
N38 T10 M6
N39 X50
...
Rapid Program sectioning is used to speed up the block search procedure; instructions belonging to
block sections different from the one being searched for are not processed.
search It is therefore necessary, after program sectioning, to enter all the instructions necessary for a
correct restarting of the machining. In particular, after a program sectioning the operator must
program (or confirm) the programmed tool and the tool on the spindle (TM6).
After resetting, section zero is operative: all the instructions contained in section zero are
however processed during the step search procedure, even if a section different from zero is being
searched for. This shortens the program because it avoids having to reprogram the fixed
information at the beginning of each section.
Example:
COVER MANUFACTURING%
N1 G37OL
:1
N10 T1 M6
N11 S1000 M3
N12 OX1 OY1 OZ1 G0 X0 Y0
...

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

it skips sections different from section 2


it goes to the beginning of section 2
Program sectioning lines also introduce local parameter, origin and tool sections; they are not
part of the part-program and are used only as tags.
Example:
...
:OS local origin section beginning signal
X1= 10.121
...
Line :OS does not produce any operation and it must not be processed as a part-program line. It
only marks the beginning of the local origin section.

1.3 ISO LINES


Only the ISO lines can contain operative instructions, these that can produce PHYSICAL action
on the machine tool.

The ISO lines consist of a line number (not necessary) and a series of elementary instructions.

1.3.1 Line linking


If a line has to contain more characters than is possible for a single line, the line can be split in
two parts that will however be considered a single block of instructions.
This is obtained by inserting the character $ before the end of the line: the next line is linked to
the line containing the $ and any letters between $ and the end of the line will be ignored.
Several lines can be linked but the maximum number of characters is 240.
Example: Same result as:
N12G0X0$ AB12
Y0Z0$
M6 N12G0X0 Y0Z0M6
N13G1... N13G1...

Note on the linking of part-program lines through "$"


The linking of several part-program lines through the "$" character is only possible in programs
executed by the CMOS memory, and not in programs executed in DNC mode.

8
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 - Files organization and structures

1.3.2 Line number


N99999.9999 When there is a line number it must be at the beginning of the line.
N99999,9999 A line number consists of the letter N followed by a number with up to 9 digits, before or after the
comma or decimal point: the specifications are the same as those for numerical values (see next
paragraph), but N is NOT a parameter (i.e. it cannot be used for expressions, etc.).
The line numbers can be in any sequence (we recommend increasing) and can be repeated
more than once in the same program. In the case of a block search procedure or jump (GO N)
the line found is always the first starting from the beginning of the program. Any second line with the
same number will not be found.

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.

1.3.3 Elementary instructions, addresses & numerical values


An ISO line consists, after the line number 'N...', of a sequence of ELEMENTARY
INSTRUCTIONS, each of which orders the execution of a special operation.
An elementary instruction consists of two successive parts:
the ADDRESS
the NUMERICAL VALUE to be assigned to the address

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

Other examples of correct programming:


999999999
0,999999999
0,00000999999999
99999,9999
X12345,678
X123456,2
X0,1234567

Examples of incorrect programming:


X000012345,67800000 error, more than 9 significant numbers
X0 ,1 a space in the midst of the number
X1,00000999999999 error, more than 9 significant digits

1.3.4 Comment lines


Comment lines can be inserted in a part-program.
Comments must be in round brackets.

; character at line start that qualifies the entire line as a comment


During the test of a part-program it may be very useful to temporarily comment out a program
line.
ISO standard defines a comment as a string container between round brackets, for example:
(COMMENT LINE)
but if the line contains a mathematical formula using round brackets, it is quite impossible to use
round brackets to enclose the whole line. For example, enclosing between round brackets the line:

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.

2.1.1 G0 - traverse positioning


Traverse positioning with axes on the path.
Modal, operative at the beginning of the part program.
G0 cancels G1, G2, G3 and is made inactive by G1, G2, G3, G41, G42.
Warning: the function G0 may be defined as non modal (active only in the block); for this
feature, please consult the machine tool builder.
G0 with 10 As many as 10 axes can be programmed simultaneously. The path travelled by the axes to
axes reach the final programmed point is straight. All the programmed axes reach the final location
together.
Warning: all movements with more than 5 axes are incompatibile with the functions G61, G63,
G110, G132, G41/G42, NURBS and with the special function Gap control used in the wire electro-
discharge machines. If more than 5 axes are programmed with G61, G63, G110 or G132, the

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

2.1.2 G1 - working linear movement


Working linear movement with axes on the path.
Modal.
G1 cancels G0, G2, G3 and is made inactive by G0, G2, G3, G40, G41, G42.
Warning: the function G1 becomes modal and active at reset if G0 has been defined as non
modal (active only in the block). For this feature, please consult the machine tool builder.
G1 for 10 Up to 10 axes can be programmed simultaneously. The path travelled by the axes to reach the
axes final programmed point is rectilinear; all the programmed axes reach the programmed point
together.
Warning: all movements with more than 5 axes are incompatibile with the functions G61, G63,
G110, G132, G41/G42, NURBS and with the special function Gap control used in the wire electro-
discharge machines. If more than 5 axes are programmed with G61, G63, G110 or G132, the
programming alarm CN8414 TOO MUCH AXES is triggered. If more than 5 axes are
programmed with G41/G42 or with GAP control active, the real time alarm CN2813 is triggered.
Feed The velocity in G1 mode is the programmed feed (F address).
No axis in movement, in no override condition (it can reach 120% at the most) with any
programmed F can exceed its own rapid rate. To obtain this, the speed with 100% override cannot
exceed, for any axis, the rapid rate divided by 1.2.
For example, if we have three axes, X and Y with a rapid rate of 10/min and Z with a maximum
speed of 5 m/min, and a movement is made starting from the origin (all values at zero) we can have
the following cases:
Movement rate with 100% override
G1 F8000 X100 8000
G1 F10000 X100 8333
G1 F30000 X100 8333
G1 F10000 X100 Y100 10000 (X and Y go to 7070 mm/min)
G1 F10000 X100 Z100 5891
In the last case the Feed of Z is max 5000/1.2=4166, and therefore also X, to obtain a rectilinear
movement. Please refer to the chapter dedicated to the management of the Feed.

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.3 G2 - clockwise circular interpolation


Clockwise circular interpolation working.
Modal.
G2 cancels G0, G1 and G3 and is made inactive by G0, G1, G3, G40, G41, G42.
Warning: the functions G2/G3 may be defined as non modal (active only in the block); for this
feature, please consult the machine tool builder.
The velocity is the programmed Feed, with the exception of the reduction of the rapid rate of the
slowest axis involved in the movement, divided by 1.2, in order not to exceed the rapid rate even
with 120% override. For example, a circle in XZ, with X rapid rate 10 m/min and Z rapid rate 5
m/min, permits a rapid rate with 100% override of 4166 mm/min.
Also compare the speed in G1.
For velocity we mean that of the centre of the milling machine, with the exception of some
adjustment in the case of correction of the tool radius (see chapter on radius compensation).
The contour plan must be selected in advance with the G25 function; this can be omitted in the
case of a system contour plan.
Please refer to the chapter dealing with contour programming.
Example:
...
N10 F1000 G0 X0 Y0 Z0
N11 G2 X100 Y0 I50 J0
...

2.1.4 G3 - counter-clockwise circular interpolation


Counter-clockwise circular interpolation working.
G3 cancels G0, G1 and G2 and is made inactive by G0, G1, G2, G40, G41, G42.
The rest is the same as G2.

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)
...

2.1.6 G6.2 - NURBS control


Z32 can control NURBSs (Non Uniform Rational B-Splines) up to the 4th order (cubic splines)
using up to three axes.
A NURBS is introduced by the G6.2. Here is a typical program:
N1 G0 X10 Y30 Z0 F1000
N2 G6.2 P3 K5 Y30 Z0 R1
N3 K5 Z20 R1
N4 K5 Y45 R1
N5 K6 Y70 Z0 R1
N6 K7
N7 K7
N8 K7
N9 G0 X0 Y0 Z0
The numbering of the N lines is used for reference purposes and is not obligatory.
The NURBS in our example begins with N2 and ends with N8.
The NURBS can be preceded by any type of motion.
The G6.2 (line N2) marks the beginning of a NURBS.
Before the line including G6.2 and during the NURBS:
- G114 must be enabled
- G113A must be disabled
- the radius compensation must be disabled
The P parameter defines the NURBS order; the possible values are 2, 3, 4, if no value is
entered, the default value will be 4. The P parameter cannot be changed inside the NURBS.
All interpolated axes of the NURBS must be programmed in the first line: these axes can be 2 or
3 and must be chosen from the NC continuously controlled axes.
The measures of the axes in the first line of the NURBS must coincide with the last ones
reached before starting the NURBS.
Note that if the NURBS is the 2-axes type (e.g. YZ) the programming of 3 axes in the first line
(e.g. XYZ) is allowed and has no negative effects on the machine motions; it is however not
recommended as it forces the calculation of the 3 axes during the whole NURBS, affecting the
mathematical calculations.

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.

2.1.7 G10 - rough fast positioning (obsolete)


Function G10 speeds up the positioning times.
G10 is used like G0 (traverse positioning) and has all the same characteristics except that the
final positioning procedure is speeded up.
G10 is modal and exclusive with G0, G1, G2 and G3.
Warning: the function G10 may be defined as non modal (active only in the block). For this
feature, please consult the machine tool builder.
The final positioning procedure is accelerated and it depends on some calibration parameters:
the time saving will be very small for every positioning if the CNC has not the special calibrations
parameters.

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).

Management of G10 with advanced speed management (G113V)


G10 permits rougher but quicker positioning with respect to the normal G0.
If the rigid motions (G113F) are active, the blow delivered by G10 on the final positioning is
more evident.
In the case of advanced speed management (G113V), which has greatly speeded up
positioning, the advantage of G10 is reduced and therefore it was considered that the best
compromise was to eliminate G10 (even though programmed) and, therefore, the blow to the axes
when G113F is active.
Therefore:
- if advanced management (G113V) is not active, G10 functions normally
- if G113V is active and the motions are soft (G113P), G10 functions normally
- if G113V is active and the motions are rigid (G113F) G10 is automatically converted to
G0

2.1.8 G12 - third axis coordination on


This function asks the CNC to interpret the programming of the third axis as interpolated with the
two axis of the plane.
Modal. Deactivated by G13.
G12 is incompatible with G111S (tracing motion); if G111S is programmed, G12 will be disabled
automatically.
The position programmed on the third axis is reached, at the end of the movement, together with
the two position of the plane. The speed when G12 is active is the programmed F, calculated on the
path (the vectorial result of the speeds pertaining to the THREE axes is equal to the programmed
Feed). Since the movement in G12 mode is calculated on the plane and the third axis is trailed by
the two axes of the plane, it is necessary to reduce the feed in proportion to the inclination.
For the management of the speed with G12 active, please refer to the paragraph Feed control
in the chapter dedicated to the programming of contours. G12 can also be active in radius
compensation (G41 or G42 active). In this case the motion of the third axis is always co-ordinated
with the other two axes.
G12 can remain enabled in radius compensation mode, even in shortened or eliminated
segments.

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:

POCKET WITH 3RD AXIS MOTION %


N1 G25XYZ G0 X0 Y10 Z0

18
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

N2 R10 F1000 G109E


N3 G42 X0 Y0 QF0
N4 G1 X10
N5 Y15
N6 X25 Z30
N7 Y0
N8 X50
N9 G40
N10 M2
G109E on the N2 line is required to execute the pocket in radius compensation mode, the
motions are normal up to the N4 included.

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.

Therefore, the tool centre motions consist of:

- motions at level Z0 up to the edge X10 Y0

- arc (incomplete) at level Z0 around the edge X10 Y0

- 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
...

2.1.9 G13 - helical Interpolation off


This instruction cancels G12 and resets the normal programming of positions.
Modal. It is operative at reset.
See example for G12.

2.1.10 G16 - re-direction of axes


On certain occasions, a program written for a given machine configuration must be executed
with a different configuration which requires a change of axes.
The change of axes can be carried out with the G16 function, which allows the axes to be re-
directed on new addresses.
For example, a machine program contains the axes X Y Z B C in this precise order. The order is
important as the re-direction is effected on the basis of the axes order: the characters following G16
are assigned to the physical axes in the same order as the list.
Therefore, a normal order is:
G16XYZBC
Now if we have a program which requires the exchange of X and Z axes (i.e. X must move
instead of Z and vice-versa).
The following instruction has to be entered before effecting the motions with the axes changed:
G16ZYX
Thanks to this instruction, Z is re-directed on the first axis (i.e. X), Y on Y (does not change) and
X on Z.
Rules:
- the characters assigned to the various axes must immediately follow G16, without blank
spaces in between
- a blank or the end of line break the character sequence and therefore interrupt G16
- the allowed names are the alphabet characters in capitals, excluding FGIJKLMNORST,
otherwise a CN1D14 program error will ensue
- if the number of characters following G16 is inferior to the number of the machines controlled
axes, the remaining axes do not change
- after G16, if an axis name is repeated in the same axis sequence, a CN1D14 program error
will ensue; for example, if a machine has the axes XYZBC and the G16ZX instruction is entered,
the result will be G16ZXZBC, therefore Z is repeated and an error will ensue
- with G53 enabled (axes referred to the base origin) or if a system subprogram is on (canned
cycle or special M) the G16 is interrupted; this avoids possible interference of G16 with essential
system programs

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.

2.1.11 G25 - choice of machining triad


Allows the operator to choose the three working axes.
Modal.
After G25, three characters with the three symbols of the axes defined as continuous on the
machine must be entered in succession. For example, G25XYZ defines that the machining triad
consists of the three axes X, Y and Z. The first two axes form the contour plane (in which it is
possible to perform circular interpolations). The other axis is an additional axis co-ordinated with the
first two (which can be used for canned cycles and other machine functions).
At power-on and at program beginning the triad defined in the machine-Settings becomes
active. It is important to define correctly the direction of movement of the axes to avoid surprises.
Attention: the G25 function can be defined as transparent at RESET and/or power-on (the last
programmed status remains even after RESET and/or at the next restart). For this feature, please
consult the machine tool builder.
Machining takes place due to the movement of the spindle with respect to the workpiece. It
should be noted that, depending on the structure of the machine, the spindle or the piece can move,
and that on the same machine the spindle can move for some axes and for others the workpiece.
To avoid confusion, the operator must not consider the physical movement of the axis but the mark
left by the spindle on the piece as a result of the motion of the axis.
Two of the three axes of the triad identify the work plane (where circular interpolation, radius
compensation, etc., are permitted). To choose which of the two is the first and which the second
axes of the plane (which can be entered also with AA and AB respectively instead of their symbols)
the operator shall:
- ideally go into the positive part of the third axis (always considered as work mark);
- ideally perform a movement towards the positive of each of the two axes of the plane;
- again, ideally, rotate the plane until one mark is positive towards the RIGHT and the
other positive towards TOP.
New work The first axis of the plane (which the operator must write first after G25) is that which makes the
plane mark towards the right, the second axis is the one which makes it towards the top.
According to ISO 841 standard, the symbols to be given to the axes are:
- X for the first axis of the working plane
- Y for the second axis of the plane
- Z for the third axis
The machines do not always follow this regulation, especially when the same unit can, with
suitable accessories, be used with either a vertical or horizontal head.
In this case nor the letter that identifies the axis, nor the direction of movement of the axis that is
to be considered positive can be changed (they are tied to the physical axis). However, the Z32 can
adapt itself to various situations, by simply programming the G25 instruction followed by the three
axes in the order described above.

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
...

Machining triad G25 with two-axes systems


If the machine has two axes (typical for lathes or simple plotters) G25 may be programmed with
only two axes: for example, on a lathe, it is possible to program G25ZX, while for a flat bed machine
(without Z axis) it is possible to program G25XY

22
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

2.1.12 G26 - end of subprogram


This signals the end of the subprogram.
When all the functions specified in the line containing G26 have been completed, the sub-
program is abandoned and the execution of the calling program (or subprogram) starts again,
starting from the line following that in which the subprogram had been called.
G26, can be programmed and is normally executed also inside a subroutine inside the
subprogram (see also the evolved lines chapter).
Example:
Main program Subprogram 20
... %
N10!GOP20! N1 HA<HB*2-HC>
... N2 !IFHA>0;GON4!
N3 Z<Z-HE>
N4 G26

2.1.13 G27 - canned cycle and permanent subprogram

G27C... Canned cycle activated


Modal.
The number that indicates what canned cycle is to be activated must be entered after G27C.
G27C0 is used to cancel the canned cycles and subtemps.
G27C0 is active at power-on and at the beginning of the program.

G27S... Activates subtemp as a canned cycle


Modal.
After G27S, the number indicating the activated temporary subroutine (subtemp) must be
programmed.
With G27S0, all subtemps and canned cycles are deactivated.

G27X Canned cycle suspended


Operates only in the block. It suspends, only for the block where it is programmed, the execution
of the canned cycle.
For further details please refer the specific chapter.

G27P... Permanent Subprogram


Modal
After G27P the number of the permanent subprogram to be activated must be entered.
G27P is used to make the permanent subprogram inactive.
For further details please refer to the specific chapter.

2.1.14 G28 - axis activation


G28 asks the CNC to keep the axis under control even when it is not involved in the movement
in progress (alive axis).

D. ELECTRON 23
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

Modal, with stop.


The name of the axis (e.g. X) to be kept alive must be specified after G28 (e.g. G28X).
Only one axis can be specified, amongst those defined as continuous by the machine settings.
To activate more than one axis G28 can be entered several times in the same line or in
successive lines.
Example:
G28Z G28A
requests that axes Z and A be kept under control
Some axes (to be defined in the machine settings) can be defined as alive until power-on: at
each program beginning this state is restored.
Warning: in machine setup it is possible to define that the axes status
(alive or not alive) be transparent to the reset (alive axes transparent to
reset). If this option is active, the axes status (alive/not alive) remain
unchanged also after a CNC shutdown.
It is possible to request the activation of an axis that is already alive, but it does not produce any
result.

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).

G28-G29 automatic cycle if disabled axis programmed


In automatic or MDI mode it is possible to program a disabled axis without having to set G28
beforehand: the result is the same as if G28 (enable) and G29 (disable) were programmed.
This automatic cycle is not executed if G98, which does not allow functions that require a stop, is
enabled.

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.

Note on the programming management of alive axes


If the movement of a disabled axis is programmed through the part-program, this axis will
automatically be enabled but only if its physical position does not coincide with that being
programmed
It is considered that the physical position of the axis coincides with the programmed position if
the error is less than the positioning error defined in the machine settings (usually some hundredth
of millimeter).
Some problems may arise if the error is too close to the tolerance value. If the measured
position of the disabled axis (which should not move) is found to oscillate slightly below and above
the calibration threshold, this may cause a CN1513 alarm.
The measured position may oscillate slightly while remaining within the positioning threshold,
therefore threshold overflow may occur if the position is already at the accepted limit, which may
occur when:
- there is a slight movement during clamping of a revolving table (or other axis) which
brings it very near to the defined threshold.
- the movement of a clamped axis slightly below the positioning threshold is programmed.
In such cases we advise not to use the automatic option to enable the disabled axis but to force
enabling directly from the part-program.

2.1.15 G29 - axis deactivation


This instruction asks the CNC to abandon the specified axis.
Modal with stop.
The name of the axis (e.g.X.) to be abandoned must be specified after G29 (e.g. G29X).

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.

2.1.16 G30 - G31 - circle incremental programming


The G31 function (modal, with axis stop, canceled by G30) activates the incremental
programming of the circle center.
It is useful to obtain a better compatibility of Z32 part-programs with those of other CNCs.
The behavior differences between G31 active and not active are indicated in the following table:

G31 active G31 not active


The parameters defining the circle The parameters defining the circle center are:
center are:
I (associated with 1st axis of the G25 tern)
I (associated with the X axis)
J (associated with 2nd axis of the G25 tern)
J (associated with the Y axis)
For example:
K (associated with the Z axis)
With G25XYZ: I is associated to X and J to Y
With G25ZXY: I is associated to Z and J to X
With circle programming, the first two With circle programming the first two axes of
axes of the tern must be chosen among tern may be freely chosen, for example:
X, Y and Z.
G25VWZ
The only allowed working planes are
G2 V W I J
XY, ZX, YZ.
I, J and K are incremental from the I, J are absolute (the circle center absolute
circle starting point (the circle center coordinates are directly expressed by I and J)
absolute coordinates are obtained by
adding the values of I, J, K to the
absolute coordinates of the circle
starting point).
Circles may be only programmed with Circles may be programmed in all modes
the following combinations: considered by the plane geometry of the Z32
CNC.
G2/G3 X...Y...I...J... (working plane XY)
G2/G3 X...Z...I...K... (working plane ZX)
G2/G3 Y...Z...J...K... (working plane YZ)

2.1.17 G33 - thread cutting


Modal in automatic mode, operative in the block in MDI mode.
Typical function pertaining to lathes, but also usable for milling machines.

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.

G33/G95 when G113X is active


G113X is incompatible with G33 (threading) or G95 movements (mm/turn).
When G113X is active, the G33 or G95 programming has the following behaviour:
- A stop is performed
- G113X is eliminated
- G33 or G95 is performed in the G113 mode related to it (typically G113F)
- If during G33/G95, G113X is not deactivated (for example with G115 or G113P or G113F),
G113X is reactivated at G33/G95 end.
If you attempt to activate G113X when G95 (mm/turn) is active, the CN2C14 INCOMPATIBLE
PARAMETERS alarm is given.
Please remember that if you deactivate G33 with a G0, G95 (mm/turn) remains active, then
G113X is NOT reactivated. To obtain the automatic reactivation of G113X, G95 must be terminated
with G94 (mm/min).

2.1.18 G34 - G35 - variable pitch threading


The term variable pitch threading indicates a threading whose pitch is not constant, but varies
continuously according to a determined variation quantity.
The variable pitch threading is programmed through two different G functions:
- G34 = rising pitch threading
- G35 = falling pitch threading
All descriptions related to the fixed pitch threading (G33) remain valid also for the variable pitch
threading (G34 and G35).
Below, the meaning of parameters related to the G34 and G35 programming is explained:
K = initial threading pitch (mm or inches) This parameter can be programmed in the same block
of G34/G35, or in preceding blocks. WARNING: if the K parameter is newly programmed in
subsequent blocks, when G34/G35 is active, an abrupt pitch variation is encountered.
I = pitch increment expressed in mm/round or in/round. This parameter can only be programmed
in the same line of G34/G35. This parameter is always positive (the positive or negative meaning is
automatically assigned by the system, depending if programmed with G34 or G35); if programmed
as negative value, its absolute value is assumed. With G34, it expresses the mm/round or
inches/round increment of the K pitch, while with G35, the decrement of K pitch value. WARNING:
if the continuous decrement of K brings to a negative value, the alarm CN1F13 - NEGATIVE OR
ZERO THREADING PITCH will be issued (in real time).
Threading movements with a fixed or variable pitch may be executed in sequence: the threading
pitch will continuously vary or remain constant, or it will have a discontinuity, depending on the
threading function and parameters programmed.
WARNING: by programming a G33, the increment I is automatically set to zero; therefore in a
subsequent G34/G35, the increment I must be newly programmed, otherwise the behavior will be
the same as G33 (fixed pitch).

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.

2.1.19 G36 - progressive number management


The operator can perform five types of operations on the progressive number, to lead the block
search procedure in case of special operations.

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.

Block search, progressive number


The progressive number assigned to elementary operations (that will affect the block search with
* or a progressive number) can reach a maximum value of 16777216 before starting again from
zero.
This number is sufficient even for very long programs. For instance, if a part-program is running
at 100 blocks per second, the progressive number occurs only after 46 hours of uninterrupted
machining and, since a minimum of 10 characters per block is allowed, the part-program would be
160 Mb long.

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 ...

2.1.20 G37 - local/global files commutation


This function makes global or local sections pertaining to parameters, origins and tools
operative.
Modal
After G37 the operator must specify two letters as follows:
G37PL to activate local section parameters
G37PG to activate global section parameters

D. ELECTRON 31
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

G37OL to activate local section origins


G37OG to activate global section origins
G37TL to activate local section tools
G37TG to activate global section tools
On reset G37PG, G37OG and G37TG are operative.
A local section is a parameter section (beginning with :PA), an origin section (beginning with
:OS) or a tool section (beginning with :TL) placed at the end of the program. One or more local
sections can be missing, the existing ones can be inserted in any order.
If G37 instruction is programmed and performed in a sub-program the local section of that
program will be activated. Neither a sub-program call, nor the return from a sub-program. will
change the operating section.
For example. if the process is 0:
MAIN PROGRAM(FILE #1)%
...
N10 G37PL
....
N15 G37TL
...
N20 !GOP100! ---------------------------  (SUBPROGRAM 100)
(REST OF MAIN PROGRAM)  SPRG.100(FILE #100)%
N21 ...  ...
...  N18G37PL ...
N80 M2  ...
 N64 G26
In this example:
- the origin section is always the global one (file 126)
- the tool section:
- is global (file 127) from the beginning to N15 of the main program
- is local (of the file 1) from N15 to the end of the program, including the sub-program
- the parameter section:
- is global (file 125) from the beginning to N10 of main program
- is local (local of the file 1) from N10 of main program to N18 of sub-program 100
- is local (sub-program 100) from N18 of sub-program.100 to the end of the main
program.
The operator must note that, although there are no particular precautions to be taken when
using local parameter and origin sections, the use of local tool sections can have serious
implications on the system. It is strongly recommended to CONSULT THE MANUFACTURER OF
THE MACHINE TOOL with regard to the effects of the local tool sections on the system sub-
programs (especially tool change, management of replacement tools, tool wear, etc.).
If G37O and the relevant origins are programmed in the same line, the G37 must precede the
origin, otherwise the origin is calculated in the old section.
Example:
...
N10 G37OL OX1 OY1 OZ1
...

32
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

2.1.21 G38 - tool changer on


The automatic tool changer is ON.
Modal.
Cancels G39: on reset G38 is active.

2.1.22 G39 - tool changer off


The automatic tool changer is OFF.
Modal.
If G39 is operating, the M6 function (tool change) will no longer be executed in automatic mode,
but it produces a machine STOP, in order to allow the operator to perform the tool change
manually.
When the operator, after changing the tool, presses the START button, the program will begin
again from the point of interruption, and the tool change operation will be considered done. The
CNC will consider the programmed tool as placed on the spindle.
Example:
...
N10 G39
N12 T10 M6 (MANUAL CHANGE WITH CUTTER R=10)
N13 G38
...

2.1.23 G40 - radius compensation off


Tool radius compensation off.
Modal. Cancels G1, G2, G3, G41, G42.
At start-up G40 is operative.
G40 will be programmed when G41 or G42 are operating, to terminate the contour operation.
When G40 is programmed the contour must already be closed.
Please refer to the chapter on Radius Compensation.

2.1.24 G41 - radius compensation, tool on the left


Tool on the left
Beginning of radius compensation: the tool is placed on the left of the piece.
Modal.
With G41 instruction the CNC enters radius compensation mode, which allows the contour of
the piece to be programmed, instead of programming the path of the cutter centre.
Radius compensation takes place in the contour plane (first two axes of the working triad).
Please refer to the chapter on Radius Compensation.

2.1.25 G42 - radius compensation, tool on the right


Tool on the right
The same as G41; but the tool is placed on the right of the piece.

D. ELECTRON 33
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

2.1.26 G43 - positive tool length compensation


Beginning of positive tool length compensation.
Modal, with stop.
It must be followed by the symbol of the axis on which the tool length compensation is to be
made (ex. G43X).
At power-on and at the beginning of the program G43 is operating on the third continuous axis of
the machine: if continuous axes are XYZUV, at power-on and at the beginning of program, G43Z
will be operating.
Attention: the G43 function can be defined as transparent at RESET and/or power-on (the last
programmed status remains even after RESET and/or at the next restart). For this feature, please
consult the machine tool builder.
After activating G43, all the values of the axis involved in the compensation are modified, so as
to consider a tool with a positive length, placed on the spindle: the length (L parameter) will be
subtracted from the displayed values; this amounts to adding L length to the programmed values.
The tool length effect is added to that of the base origin and any supplementary origin.
For more information see the chapter on tool management.
See the example for G45.

G43 for lathes


When G43 is active, the parameters LX and LZ (related to the tool lengths along X and Z axes
of the lathe) are used instead of L.
In programming for lathes, the axis after G43 must not be indicated.

2.1.27 G44 - negative tool length compensation


The same as G43, except for the sign of the compensation.
Attention: the G44 function can be defined as transparent at RESET and/or power-on (the last
programmed status remains even after RESET and/or at the next restart). For this feature, please
consult the machine tool builder.
When G44 is operating, L parameter will be subtracted instead of being added to the
programmed values of the axis involved in the operation.
As Z32 admits a negative L parameter, it is easier for the operator, to change the sign of L
parameter than to use G44 function.
See the example for G45.

G44 for lathes


When G44 is active, the parameters LX and LZ (related to the tool lengths along X and Z axes
of the lathe) are used instead of L.
In programming for lathes, the axis after G44 must not be indicated.

2.1.28 G45 - tool length compensation off


This instruction deactivates tool compensations (G43 and G44).
Modal, with stop.
Attention: the G45 function can be defined as transparent at RESET and/or power-on (the last
programmed status remains even after RESET and/or at the next restart). For this feature, please
consult the machine tool builder.

34
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

G45 does not modify L parameter.


Example: the values of the CNC display are reported in the comments (the axis do not move)
...
N10 G45 G0 X0 Y0 Z0
N11 L100 (X=0, Z=0)
N12 G43Z (X=0, Z=-100)
N13 G44Z (X=0, Z=+100)
N14 G43X (X=-100, Z=0)
N15 G45 (X=0, Z=0)

G45 for lathes


When G45 is active, the parameters LX and LZ (related to the tool lengths along X and Z axes
of the lathe) are deactivates instead of L.

2.1.29 G53 - origin and length compensation off


This instruction suspends the origin and length compensation and dimensions transformations:
rototraslation, mirroring and scale factor.
Modal, with stop.
It is used to program machine movements in absolute dimensions (including the base origin,
only).
The programmed state for origins and length compensations (G43-44, Origin, ) remains
freezed when G53 is active, and is restored by G54.
The operator is allowed to modify origins, G43, etc., during G53 operation: the effect of these
modifications is suspended until G54 instruction.

2.1.30 G54 - origin and length compensation on


It cancels G53 effect.
Modal, with stop, active at reset.
G54 restores the origins and length compensations memorized and suspended by G53: if the
memorized situation provides for origin and length not operating, they will be inactive even after
G54.
When G54 is executed the parameter L is acquired as actual tool-length corrector.
See also the tool-management chapter.
Only for the machine-tool manufacturer: G54 instruction, if programmed inside a sub-program
relevant to a special M function or a canned system cycle, will only cancel any G53 instruction
programmed inside that special sub-program. Therefore, a G53 instruction, programmed in the
users program, cannot be cancelled through a G54 instruction inside a special sub-program. In
other words, the special sub-program is transparent to G53/G54.
To use G102/G103 inside system sub-programs, instead of using G53/G54, please, see the
paragraph concerning G102 and G103.
Example: (displayed values in brackets)
...
N10 G37OL OX1 OY0 OZ0 L0 G0 X0 Y0 Z0 G43Z G54
N11 L57,5 (X=0, Z=-57,5)

D. ELECTRON 35
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

N12 G53 (X=+68.3, Z=0)


N13 OX2 L100 (X=+68.3, Z=0)
N14 G54 (X=+10, Z=-100)
...
:OS
X1=-68.3
X2=-78.3

2.1.31 G55 - mirroring off


This cancels the effect produced by G56.
Modal, active at reset.
This cannot be programmed, while G41 or G42 are operating.
Mirroring can also be stopped by G53.
See chapter on Mirroring.

2.1.32 G56 - mirroring on


This instruction asks the CNC to perform a mirror contour with respect to a mirroring axis, which
is identified by the point (IS,JS), and by QS (inclination).
Modal.
This can operate during radius compensation (G41 and G42) but it cannot be programmed while
G41 and G42 are operating.
See chapter on mirroring.

2.1.33 G61 - measuring movement


This instruction asks the CNC for a measuring movement with probe.
Active only in the block, with stop.
It cancels G1, G2, G3, G10. At the end of the movement, G0 remains active.
See the chapter Special performance, par. Measure feeler G61.

2.1.34 G62 - working movement with PLC stop


This instruction asks the CNC for a movement which can be stopped by machine logic.
Active only in the block ; with stop.
It can be programmed during movements in G1, G2, G3 (simple movements, only: not during
radius compensation).
Please refer to the chapter Special Performances, paragraph G62, working movement with
stop.

2.1.35 G63 - synchronized tapping


Only active in the block, with stop.
The G63 asks for a tapping movement, composed of:

36
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

- forward with pitch K to the programmed dimension


- spindle reversing
- backward to the starting point.
The movement of the programmed axes (normally, one axis only: Z axis) is strictly linked to the
spindle during the whole cycle (a K increase for each spindle revolution).
Example:
...
N10 G0 X0 Y0 Z10 S600 M3
N11 G63 K1 Z-50
N12 G0 X-10
N13 G63 Z-50
...
N10: rapid positioning at the beginning of the hole and spindle on
N11: tapping cycle. The spindle needs to be at a steady speed before beginning the tapping
operation.
Cycle operations:
- the CNC is acquiring the initial direction of the spindle rotation. Durino this phase,
Z32 monitors the rotation speed and doesnt start the movement until: the rotation
direction is not correct and the actual rotation speed is not at least 25% of the
programmed speed.
- waiting for the spindle to pass the zero position
- Z axis starts quickly. Within the space necessary for the acceleration of the axis,
there is no synchronism between spindle and axis movement: leave an adequate
margin so the synchronism will be reached on air, before machining starts.
- tapping with 1 mm pitch and Z axis synchronized with the spindle up to Z-50 level.
- spindle reversing. During the reversing time Z axis, which is connected to the spindle,
goes beyond the Z-50 level. If the axis goes too far beyond the final position (the
maximum overtravel is defined in the machine settings, normally 10 mm) the alarm
message CN0713 occurs. In any case, leave sufficient space at the end of the hole.
- return (with Z axis still connected to the spindle) to the starting level (Z10).
- positioning of Z axis at the starting level (Z10). As the axis needs a stopping
distance, the synchronism between Z axis and spindle is abandoned when a certain
distance is reached: the programmer must leave a suitable safety distance.
N12: spindle reversing (which goes back to M3) and movement at rapid rate to X-10.
N13: another tapping cycle. Please note that the spindle must have finished the reversing
operation before beginning N13: The start of a subsequent tapping is delayed until the
spindle rotation direction has been inverted and the actual rotation speed has reached at
least of the programmed speed. The start of a subsequent tapping is however enabled
after 5 seconds from the preceding inversion.
The K tapping pitch is always in millimeters, also on machines set in inches.
It is possible to do multiple passes on the same thread (only provided that the tool has not been
rotated) because the start of the movement is synchronized with the passage of the spindle through
zero position.
No functions requiring stopping can be programmed if G33 is operating except for G4 (i.e. all the
auxiliary functions M, MA, MB, MC, S, 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
If the motion of a dead axis is programmed (which should be therefore activated and then
deactivated) the following alarm message is launched:
CN6214 LIVE AXES CHANGE + G33/G34/G35/G63

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.

2.1.36 G70 - G71 - millimeter/inches programming


G70:
- Forces inches programming on a machine defined as millimeter in setup.
- Restores the standard behavior (inches programming) on a machine defined as millimeter in
setup.
G71:
- Forces millimeter programming on a machine defined as inches in setup.
- Restores the standard behavior (millimeter programming) on a machine defined as inches in
setup.
The G70/G71 functions stop the machining.
After a reset, the standard behavior defined in setup is restored (elimination of any forcing).
The following rules apply:
- During the forced behavior (for example, millimeter machine forced in inches) all linear axes
are scaled with the 25.4 scale factor (1 inch = 25.4 mm). All rotating axes are not scaled.
WARNING: if the machine uses rotating axes, it is mandatory to define them as such in the setup,
otherwise they also will be subjected to the 25.4 scale factor.
- It is possibile to program any geometric profile (G0, G1, G2, G3), including fillets (RR) and
chamfers (RB). The whole programming of geometric elements is scaled according to the G70/G71
mode in use.
- After activating a forced behavior (millimeter machine forced in inches or inches machine
forced in millimeter) the following values are considered in inches (if the machine was in millimeter,
or in millimeter if the machine was in inches):
linear axes positions (X,Y,Z,) inside movement blocks (G0, G1, G2, G3)
circle centers (I,J) inside movement blocks (G2, G3)
translations (DA DB DC)
connecting radiuses (RR)

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)

2.1.37 G80 - tapping off


This instruction cancels the effect of the G84 function.
Modal, with stop.
G80 is active at power-on and at reset.

2.1.38 G84 - tapping on


This function makes override, test and single block controls inactive, and gives the relevant
information to the PLC. It stops the progressive number so that no movement inside the tapping
operation can be searched for. See canned tapping cycle, also.
Modal, with stop.
Example:
...

D. ELECTRON 41
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

N10 G0 Z0 F200 S150 M3


N11 G84 G1 Z-56
N12 M4
N13 Z0
N14 G80 G0 Z-100
...

2.1.39 G90 - programming absolute axis positions on


Axis position with respect to active origins is programmed
Modal, active at reset.
This cancels, and is cancelled by G91.
It may be introduced in all functioning modes, traverse, working, radius compensation, G98,
permanent formulae.

2.1.40 G91 - programming incremental axis positions on


Axis position programming with respect to point previously reached.
Modal, it cancels and is cancelled by G90.
It can be introduced in all functioning modes, traverse, working, radius compensation, G98,
permanent formulae.
It is allowed to program again G91 when G91 is already active.
G91 has been introduced to reduce the part-program length when the movements are formed by
many short lines: using G91 will be typical when there is part-program generation with CAM
systems or restitution of digitized surfaces.
The G91 effect is limited to following conditions:
a) a continuous axis is programmed in an ISO line with explicit numerical value (not with
mathematical formula);
b) no special system sub-program is running (canned or special M cycle);
Any programming of axes parameters in evolved line is not influenced by the G91: the
parameter associated with axis position assumes the programmed value, same as with G91 not
active.
Programmed increments are microns multiplied by the value of the parameter HX when the G91
is programmed to avoid the need for decimal points.
Examples:
HX1G91 micron programming on
HX10G91 programming in hundredths of millimeter on
HX1000G91 in programming millimeter on
The HX value may have decimal part and may be obtained by mathematical formulae.
To calculate the position increment this value will be divided by 1000.
WARNING
The HX value must be programmed before G91 (G functions are processed
during the line ANALYSIS, that proceeds with the same programming
order): therefore, it is a mistake to program
G91 HX10

42
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

If we want to program in incremental hundredths because the value of HX when G91 is


processed is not yet 10.
When G91 is active the programmed incremental dimensions for all the continuous axes (there
can be more than one in the same line) are added algebraically to their previous value.
The next example (only didactic and not realistic) contains a lot of possible combinations.
%
X0 0 Value
HX10 G91 Hundredths programming on
X100 Increment 100*10/1000=1 mm, so 1mm position
!X=X+0,5! Position does not change, X parameter at 1,5mmm
X50 The parameter was 1,5 increase 0,5 so 2mm position
X0 The increase 0 so position remains at 2mm
X<X+1> It is not a number so the absolute programming takes place.
X parameter value was 2 so position goes to 3mm
X-100 2mm position
HX100 G91 Change of increment weight to decimals
X100 10+2=12mm position
X100,04 12+10,04=22,004mm position
X<100> It is not a number so absolute programming takes place 100mm
position
X100 110mm position
G90 Incremental programming off
X<X+10> X parameter value was 110 so 120 position
Incremental programming requires special attention to the errors which can accumulate
indefinitely.
Errors can accumulate as follows:
1) Directly on the computer that originates the part-program. To avoid accumulation of
errors the truncating error of each value must be carried forward in the calculation of the
next value;
2) On Z32. As the decimal values (for example 0,001 mm) cannot be represented
precisely in the format used inside the Z32 (floating point binary), we have an error
which cannot be eliminated for every programmed increment. The value of this error can
9
be a maximum of about one part on 10 of the actual value. This means, for example,
that when working on maximum values of 1000 mm, there can be a maximum error of 1
micron after the sum of 1000 increments. From test performed it has been seen that
100,000 increments of 0.01 mm starting from value 0 lead to a final value of 999,986
instead of 1000 (hence the error is 1.4 microns after 100,000 increments).
The error is very small, but it is a good idea to avoid the indefinite accumulation of errors that
could be unacceptable particularly in very long programs.
It is advisable to send the absolute values every so often: it has been seen that by putting the
numerical value in acute brackets it is interpreted as an expression and is therefore taken as
absolute programming of the value and the parameter.
It has already been said that incremental programming does not act inside a system sub-
program. This avoids problems in the event that the operator forgets to cancel the incremental
programming before calling up a special sub-program (imagine the consequences of a tool change
with special sub-program if the values are considered incremental ).

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.

G91 independent of HX and with axes position even through expressions


"Standard" G91 (incremental programming) has the following limitations in the conditions of use:
- The HX parameter is a "multiplier" of the programmed dimension (HX1 = dimension in
microns, HX1000 = dimension in mm)
- The axis dimension must be programmed with an explicit numerical value and not as the result
of an expression.
With appropriate machine settings (for this, please consult the machine tool builder), a different
G91 incremental programming mode can be forced:
- No longer dependent on the HX parameter (dimensions are always in mm, as in non-
incremental programming)
- Axes positions can also be programmed with expressions.
For example, when this G91 mode is active:
G91
HA3.42
G0 X38.432 Y<HA+0.563>
Programs a point moved in increments by 38.432 mm in X, and 3.42+0.563 = 3.983 mm in Y.

2.1.41 G93 - feed programming as inverse time


The ISO G93 function allows the feed programming as inverse time (in minutes) for the
execution of a certain motion.

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

- the rapid traverse speed is not influenced by G93

- 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

The speed resulting from G93 is limited to the rapid traverse.

G93 remains active with G98.

2.1.42 G94 - feed in mm/minute


Feed programming, in mm/minute (or degrees/min, or other units)
Modal, active at reset.
G94 cancels G93, G95, G33 and G131 and is cancelled by G93, G95, G33 and G131.
F parameter (feed) has mm/mm value (or other units) when G94 is active.

2.1.43 G95 - feed in mm/revolution


Feed programming in mm/revolution (or degrees or other units).
Modal.
G95 cancels G93, G94, G33 and G131 and is cancelled by G93, G94, G33 and G131.
F parameter (feed) has mm/mm value (or degrees or other units) when G95 is active. The
feedrate depends on the spindle speed.
During accelerations and decelerations, there may be a slip of the spindle with respect to the
feed, to maintain velocity and acceleration within the machine dynamics.
Unlike the G33 that links axis motion to spindle motion, this slipping is no more recovered.
The maximum feed limits are still valid as described in paragraph on G1.
Example
...
N10 S1000 M3 (SPINDLE AT 1000 r.p.m.)
N11 G95 F0,1 (FEEDRATE 0,1 mm/revolution)
N12 G1 X100
...

G33/G95 when G113X is active


G113X is incompatible with G33 (threading) or G95 movements (mm/turn).
When G113X is active, the G33 or G95 programming has the following behaviour:
- A stop is performed
- G113X is eliminated
- G33 or G95 is performed in the G113 mode related to it (typically G113F)
- If during G33/G95, G113X is not deactivated (for example with G115 or G113P or G113F),
G113X is reactivated at G33/G95 end.
If you attempt to activate G113X when G95 (mm/turn) is active, the CN2C14 INCOMPATIBLE
PARAMETERS alarm is given.
Please remember that if you deactivate G33 with a G0, G95 (mm/rev) remains active, then
G113X is NOT reactivated. To obtain the automatic reactivation of G113X, G95 must be terminated
with G94 (mm/min).

JOG in G95 (feed in mm/revolution)

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.

2.1.44 G96 - constant cutting speed in m/min


Cutting speed in m/min.
Modal.
This cancels G97 (r.p.m.) and G33 and is cancelled by G97 and G33.
This is a typical function for lathes.
With G96 active, the S parameter (speed) has the meaning of m/min: the spindle speed is
calculated, so that the cutting speed is equal to the programmed speed (S), considering that the
distance of the tool from the rotation centre of the spindle is equal to the value of the axis with logic
number = zero (X axis, normally).
X axis dimension is corrected with supplementary origins and any length compensations.
Example:
...
N10 X100 (RADIUS)
N11 G96 S200
...
In N11, the spindle speed is 318.3 r.p.m., that is 200/(0.1*2*PI) to keep constant and equal to
200 m/min the peripheral speed of the spindle at a distance of 100 mm from the rotation centre.
Spindle speed is updated in real time to keep cutting speed constant during movements which
vary the distance from the spindle.
In order to avoid excessive speeds, when the distance is very reduced, with G96 active, the MS
MS
parameter (which may have been programmed before) determines the maximum spindle speed
max.
allowed (in r.p.m.). The operating MS is the one present at the moment of the last programmed S: if
speed
MS parameter is programmed again, the limitation will not change until the operator programs a
new S.
The tool may go beyond the rotation centre (from X+ to X- and vice versa): the speed is however
determined by the absolute value of X axis; the programmed MS will limit speed when the axis is
passing through the zero position.
After programming G96 or G97, the spindle speed is freezed to the last speed until a new S is
programmed. This operation allows movements at the maximum speed (or tool changing
operations for lathes) without variations to the speed of the spindle caused by movements of X axis.
During this freezing the spindle override is not operating.

JOG in G96 (SPEED in m/min)


An option may be enabled in machine setup data, allowing to execute JOG movements when
G95 (feed in mm/round) or G96 (speed in m/min) are active.
The activation of this feature, bring to two consequences:
- during the JOG movement, no G94 (mm/min) nor G97 (rpm) are forced

46
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

- if a programmed F is active (for example, switching from semiauto to JOG, without


reset), the programmed feed is assumed as JOG feed, instead of default feed.
This feature is particularly useful for lathes, but may be also valid for milling machines, where
only the second effect is significant (JOG feed equal to the programmed feed). For this feature,
please refer to the machine tool builder specifications.

2.1.45 G97 - spindle in r.p.m.


Spindle speed programming in r.p.m.
Modal. Active at reset.
This cancels G96 and is cancelled by G96.
After G97, the spindle speed (S function) is programmed in r.p.m.
After programming G96 or G97, the spindle speed is freezed to the last speed until a new S is
programmed. This operation allows movements at the maximum speed (or tool changing
operations for lathes) without variations to the speed of the spindle caused by movements of X axis.
During this freezing the spindle override is not operating.

2.1.46 G98 - special linear interpolation (obsolete)


This function activates a special interpolation mode suitable for programming with points in very
close succession. It allows up to 5 axes to be programmed simultaneously.
Modal. It is cancelled by G99; it deactivates of G0, G1, G2, G3, rototraslation, mirroring, scale
factor.
Please refer to the chapter on Obsolete functions: Special Interpolation on 5 Axes.
Obsolete function. Do not use it.

2.1.47 G99 - G98 interpolation off (obsolete)


This cancels G98 effect.
Modal. This restores the status of G0, G1, G2, G3, rototraslation, mirroring, scale factor, to the
status previous to the G98.
Please refer to the chapter on Special Interpolation on 5 Axes.
Obsolete function. Do not use it.

2.1.48 G100 - data from part-program to PLC


This instruction writes the part-program AU parameter in the PLC word AU.
Active only in the block, with stop.
Instruction to be used according to the specifications given by the manufacturer of the machine
tool, which fixes the effect of AU word, in the PLC.
The whole of the AU parameter, BCD coded, goes into the AU word logic. If AU parameter is
more than 9999, the value 9999 is transferred in the PLC word AU.
This performance is reserved to the manufacturer of the machine tool: the end user must not
use this instruction, except for special performances agreed with the manufacturer. The
manufacturer should protect the PLC against incorrect programming of G100 instruction by the end-
user (for example, using the 5UC bit which signals that a system sub-program is running).

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.

2.1.49 G101 - data from PLC to part-program


This transfers the PLC AE word to the AE part-program parameter.
Active only in the block, with stop.
Instruction to be used according to the specifications supplied by the manufacturer of the
machine tool, which assigns the meaning of AE in the PLC.
The PLC AE word, considered as whole BCD, is transferred to the AE parameter. If it is not BCD
coded, the result will not be correct.
G101 is normally performed during block search procedure.
See chapter concerning the block search procedure.
Example:
...
N10 G101
N11 !IF AE=95;GON40!
...
The 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.

2.1.50 G102 - store current status


Store current program status.
Active only in the block.
The status of the following programmed functions is saved by G102 in a memory stack, to be
later restored by G103.
G37... local/global sections
G27C... canned cycle
G53/G54 suspension of origin and length compensation, rototraslation, mirroring, scale
factor
G25... working plane
The stack may contain up to 7 states: if the operator tries to save more than 7 states (that is,
there are more than 7 G102 instructions unloaded), the CNC will show the error message CN1D14
with the cursor positioned next to G102.

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.

2.1.51 G103 - restore status


G102 restores the last program status and shifts to the previous status.
Active only in the block, with stop.
The restored conditions are the same as those saved through G102:
G37... local/global sections
G27C... canned cycle
G53/G54 suspension of origin and length compensation, rototraslation, mirroring, scale
factor.
G25... working plane
If there is no restore status previously saved (if we programmed more G103 than G102), the
CNC will give the error message CN1D14, with the cursor positioned next to G103.

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

N9!L=100! Z does not change, because L is programmed in an evolved


line.
N10 G102
N11 G103 because the status of origins and lengths do not change,
corrections are not calculated again and therefore Z does not
change
N12 G102
N13 G53 nothing is changed because no origins or L are operative.
N14 G103 as the status is changing from G53 to G54, origin and length
compensation will be calculated again. Z value = -100.
N15 G102
N16 OX1 global X1 origin is activated, X value=+50
N17 G103 global origin OX1 remains active, X value=+50
N18 G102
N19 G53 the origin is cancelled, X value=0
N20 G103 the status has changed and so the origin is calculated again:
X value=+50
N21 G37OL local section is activated OX1 global origin remains active
N22 G102
N23 G53 origins are deactivated
N24 G103 status G53 is changing; origins are calculated again: X1 global
origin previously programmed is activated again; it is reset as
global origin, even though local origins are now operating.

2.1.52 G104 - read active tool


This instruction transfers to HX parameter the T value pertaining to the tool placed on the
spindle.
Active only in the block.
Example:
...
N10 T101 M6
N11 G104
...
Here the parameter HX will be equal to 101 if the tool on the spindle is really T101.
But if there is a special tool management and a different tool replaces T101 (example, because
T101 is a worn tool), here HX will be equal to the T.. of the replacing tool, that is placed on the
spindle.

2.1.53 G105 - read current axes position


The current physical position of all axes of the machine are brought into the dimension
parameters.
Active only in the block; with stop.

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.

2.1.54 G106 - radial programming


Modal; it is always active for milling machines on reset; it cancels and is cancelled by G107.
This function is used for lathes, when the radial programming must be forced. After G106, X axis
and J parameter are measured on the radius. See G107, for the example.

2.1.55 G107 - diameter programming


Typical function for lathes.
Modal; it is always operative for lathes on reset; it cancels and is cancelled by G106.
After G107, X position and J parameter are considered diametral (the physical movement is half
the programmed value).
Example (valid for lathe):
% on reset diametral programming on
N1 G0 X10 X axis to position 5, diameter 10

D. ELECTRON 51
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

N2 G106 radial programming on


N3 X10 X axis to position 10, diameter 20
N4 G107 X10 X axis to position 5, diameter 10

2.1.56 G108 - acceleration and feedrate limits


Modal, with stop.
G108 is followed by a letter which can be A or F.
G108A function transfers the value of HX parameter in an acceleration limit, G108F transfers the
value of HX parameter in a feedrate limit
Example:
HX200 G108A acceleration limit: 200 mm/sec/sec
HX8000 G108F feedrate limit: 8000 mm/min
When using G108 the operator must know the acceleration and speed limits imposed by the
manufacturer of the machine tool, it must therefore be used in collaboration with the manufacturer
or by the manufacturer himself in his special sub-programs.
G108 function can only reduce the system limits fixed by the manufacturer of the machine tool:
its effect can be eliminated by programming limits higher than those of machine settings.
G108 can be useful in case of permanent formulae (refer to specific chapter) with multiplicative
factors of the axis positions greater than 1. In this case also speeds and accelerations are
multiplied as well (possible error message: CN0013, CN0113 axes out of control): by setting lower
limits, the operator resets the correct functioning of the axes, thereby eliminating tracking errors.
For example there is a rotating B axis with traverse of 5000 mm/min and acceleration of 300
degrees/sec/sec.
Suppose that the programmer wants to apply a permanent formula (e.g. to program B in mm on
a diameter of 57.3) which multiplies the values of the B axis by 2: without using G108 instruction,
the traverse (500*2=10000 degrees/min) and the maximum acceleration (300*2=600
degrees/sec/sec) would vary.
To bring B axis back within the allowed limits, the feedrate can be reduced to 2500 degrees/min
and the acceleration to 150 mm/sec/sec. Subsequently by applying the permanent formula (which
multiplies by two) feedrates will be brought back to the real ones.
...
N10 HX2500 G108F
N11 HX150 G108A
N12 B<<B*2>>
...
The limit is applied on every axis involved in the movement, obtaining the unwanted side effect
of reducing feedrate and acceleration pertaining to axes which do not need it. If the slowing is not
tolerable, the operator can cut the limits from the program, before performing movements that do
not need them.
The limits upon which G108 functions act, are also accessible by the PLC to be varied in real
time: request information from the manufacturer of the machine tool to avoid possible
inconsistencies.

2.1.57 G109 - personalization of radius compensation


Modal.

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).

G109A G109B G109C G109D G109E G109Z


With these functions it is possible to modify the number of segment look-ahead or to restore an
obsolete radius compensation mode.
The following combinations are possible:
G109A look-ahead of three segments (active at reset)
G109B four segments
G109C five segments
G109D six segments
G109E seven segments
G109Z obsolete mode, three segments, possible errors up to 0.04 mm with
programmed tool radius of less than 0,05 mm

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:

EXECUTION WITH G109S%


T46M6
G109SG0X0Y0Z0
F10000S20000M3
G114RA.01HR.03
G113X G113A
G41...(radius compensation)
...
G109S is only effective on edges generated by two linear segments. If one of the two segments
is an arc (which however would impede radiusing) the standard linkage arc function will be
introduced.

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

G41/G42 radius correction in cutting mode


The normal Z32 radius correction is designed for shaving removal machines, whose target is to
respect the programmed profile: it is expected that also important profile parts are not machined if
the tool is too large to go inside them.
The normal Z32 radius correction explores in advance up to 7 profile segments, searching not
machinable parts. In case of complex profiles, composed by a large number of small segments, it is
possibile to encounter situations where the profile cannot be solved, thus triggering alarms CN2B14
NOT COMPATIBLE PROFILE.
This strategy is not optimal for thermal sheet cutting machines (plasma, laser, etc.). In this case:
- if there are zones where the tool cannot enter in a cavity, it is better to damage the tight zone
than to avoid to cut the material
- in no cases the alarm for a not compatible profile is useful, also if the profile cannot be
analyzed. it is always better to execute a not perfect cutting, producing a piece which can be
recovered in most cases, than a certainly not good piece and a large time expense to recover the
machining after the alarm.
The function G109Y prepares the Z32 for the radius correction in cutting mode, following the
strategy above described. This strategy is dedicated to the thermal cutting machines and must be
programmed before the activation of the radius correction (before G41/G42). Once programmed,
the G109Y is modal and retentive: its effect may be canceled only with a reset or by the starting of a
new part-program.
When the special G109Y mode is active and if the radius correction is also active, only
stopping functions may be programmed. For example, during radius correction with G1909
active, the following can be programmed without generating an error:
- auxiliary functions M, MA, MB, MC
- dwell time G04D
If a stopping function is programmed during radius compensation with G109Y active, the
following operations are performed:
- profile completion with radius correction (same as programming G40 end of radius
correction)
- execution of stopping function
- restore the radius correction from the interruption point
Clearly the profiles executed with or without the stopping function may differ, depending on the
point where the function is programmed.
For example, in presence of an internal 90 degrees corner, both entry and exit segments are
normally shortened to respect the programmed walls, but if a stopping function is programmed right
on the corner, the entry segment is not shortened, but executed entirely: the not punctiform cut
enters in the exit wall, and the corresponding segment assumes a different inclination to recover the
error.
It is responsibility of the part-programmer to activate stopping functions on adequate points on
the profile, where this behavior is acceptable.
If G109Y is not active, the behavior doesnt change, i.e. stopping functions are not allowed with
radius compensation active.

2.1.58 G110 - rough-machining macrofunctions


G110 is a very complex function that is also very difficult to explain fully. It is reserved for
D. Electron for the development of macros according to the specific customers request.

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.

First and last line number


HX HY

56
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

The profile is identified by a first and a last line number.


When entering G110, the HX parameter contains the first line number and the HY parameter
contains the last one.
To allow G110 to find the first and last line numbers, these must be written according to the
following rules:
There must be no intermediate spaces nor spaces at the beginning of the line
Initial zeros must be omitted (line zero is N0)
decimals must be indicated by using a comma and not a decimal point.
Non-significant decimal zeros must not be included
Up to 4 integers and 3 decimals or 5 integers and only 2 decimals are admitted
Should more than one line with the same number exist, only the first is valid
It is not necessary that the first line number be lower than the last line number, it must
only be possible to reach the last line from the first line.
Examples (Line numbers and related HX):
N0 HX0
N1 HX1
N1,3 HX1,3
N1.3 error: decimal point
N1234,567 HX1234,567
N 37 error: intermediate space
N12345,56 HX12345,56
N03 error: initial zero
N12,30 error : insignificant decimal zero
N12345,567 error: too many significant figures

Slope and cut increment


HT K
The required roughing cuts are transmitted to G110 through the HT (slope) and K (increment)
parameters.
The HT slope value represents the direction and angle of inclination of the movement during the
cutting according to Z32 conventional representation:
slope expressed in degrees
positive counter-clockwise direction
0 degrees coinciding with the first axis of the plane
The K increment represents the increment of the individual cut feeds and is expressed in
millimeters (in general the displayed units, if not millimeters).
To determine whether the intersections with the profile are positive or negative, G110 uses only
the increment sign. The value of the K increment has no importance for G110, as this value is
handled by the macro.
If K is positive, this means that the increment of the cut feed is towards the left, while a negative
K means that it is towards the right.

Height of cutting line


HR
Is used to position the straight cut line (having a HT slope) in the machining plane.

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

First point, G110T0


Call: G110T0Py (y = 0, 1, 2)
Function: searches the specified profile for the first point encountered by the cutting line starting
from infinite and displaced parallel to itself in the direction of the cut increment.
Input parameters:
HX HY first and last line number
HT angle of the cutting line
K cut increment
Output parameters:
HX HY dimensions of the point found (HX 1st axis, HY is the 2nd axis)
HR corresponding height of the cutting line
AN pre-length of the point found

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

- if contouring is to be made up to the negative intersection, just invert the K increment


input
- due to internal organization during contouring there is a slow down at the end of each
programmed segment.

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.

In G110T2, if the AN input is <0, continuous contouring is performed.


Entering G110T2 with AN<0 has a particular meaning: the whole specified contour is executed
in the same way as outside the G110.
In practice, if AN<0, G110T2 is equivalent to:
- GOPx jump to the program containing the profile to be performed
- GON..-N.. jump to the sequence of lines defining the profile
- G26 at the end of the sequence of lines
Therefore, with AN<0, G110T2:
- does not slow down at the end of each segment even when G114 is disabled
- ignores the cutting line and does not attempt to compute intersections
- executes the whole profile including the initial transfer section between the current point
of the tool centre and the initial profile point.

Stop display, G110T3


Call: G110T3
Function: stops displaying the program lines
Input/output parameters: none
Remarks:
- if G110T3 is already active it is ignored
- it can also be used outside the rough-machining macro
- it can be used to avoid waste of time: if G110T3 is not used, the N/C must display all the
blocks contained in the profile specified by G110. As a result, especially in the case of
long profiles, there is a pause at the beginning of each G110.

Start display, G110T4


Call: G110T4
Function: resumes the display interrupted by G110T3
Input/output parameters: none
Remarks:
- if G110T4 is already active it is ignored

Dimensions, G110T5

Call: G110T5Py (y= 0, 1, 2)

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

G110T6 multiple intersections analysis

Call: G110T6Py (y= 0, 1, 2)


Function: executes the analysis of a profile and gives back information regarding multiple
intersections in form of parameters. Valid only for closed profiles, to be used for the lathes
emptying macro.
Input parameters:
HX HY HR HT K as per G110T1
AN if not programmed, all intersections are requested, starting from the farthest; if
programmed only intersections having a distance from the origin (in the same
direction of pass line) higher than AN are requested.
AP index of first usable PAR[ ] (must be < 504 in order to reserve two groups of four
values)
KA number of intersections to be inserted in PAR[] parameters on output (minimum
2, maximum the number filling all PAR[ ] up to 512; i.e. AP+4*KA<512)
If AP and KA dont correspond to the above limitations, an alarm CN6414 G110 WRONG PAR[ ]
NUMBERS is issued.
Output parameters:
AN distance of last intersection inserted in PAR[ ] parameters
BN preliminary total profile length
BP preliminary initial G0 movements length
KA total number of intersections found (included those not inserted in PAR[ ]
parameters because of lack of space).
Intersections found are described in PAR[ ] parameters following this rule:
- intersections are inserted ordered respect to the direction of pass line. Their position relative to
profile start doesnt matter, but their geometrical position.
PAR[i] contains the intersection preliminary length
PAR[i+1] contains the intersection sign (+1=positive, -1=negative)
PAR[i+2] contains the intersection position along the first axis
PAR[i+3] contains the intersection position along the second axis

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.

Analysis starting from a point that is on the cutting line


To solve complex situations deriving from multiple intersections with the cutting line, may require
a repetition of the analysis after the first two intersections are found (one negative and the next
positive) to find the second negative intersection and the next positive one and so on.
In this case, the analysis can be repeated by starting from the pre-length of the previous positive
intersection.
If the AP parameter is merely transferred into AN before repeating the analysis, the initial point is
exactly on the straight cut line: calculation approximations may allow to consider the point as the
first negative intersection or not.
We recommend to start the next analysis at least 1 micron ahead of the previous positive
intersection (that is, AN = AP + 0.001).

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

Cutting line tangent to an arc


Should the cutting line be exactly tangent to an arc contained in the profile, the result may be
(depending on the calculation approximation):
- the circle does not intersect
- the circle intersects in two coinciding points
- the circle intersects in two separate points that are very close to each other.

Cutting line coinciding with a straight segment


If the cutting line coincides exactly with a straight segment contained in the profile, a number of
results are likely to be obtained. As usual, these depend on the approximations and are therefore
impossible to foresee.
Any of the following combinations is possible:
- the segment does not intersect and is all on the right
- the segment does not intersect and is all on the left
- the segment intersects from right to left, the inter. point is any point inside the segment

Order of the intersection points


It may be necessary to distinguish inside the macro if, on the cutting line, an intersection point is
ahead or behind with respect to another point.
If the points are P1 (X1 Y1 dimensions) and P2 (X2 Y2 dimensions) and HT is the angle of the
cutting line, the oriented distance between the two points is given by the following formula:
d = (X2 - X1) * cos (HT) + (Y2 - Y1) * sen (HT)
The distance found is positive if point P2 is ahead of P21 on the cutting line.

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.

2.1.59 G111 - special tracing movements


This function allows the programming of tracing movements with an analog tracer. For further
information, see the M46 Manual Model Digitising on Z16 and Z32.

D. ELECTRON 63
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

2.1.60 G112 - synchronization with ML logic


During automatic execution of a program, Z32 calculates the movement lines in advance on real
execution. In a few cases it is necessary, when we want to change some data with the PLC, to
eliminate this shifting: the part-program must wait the PLC to synchronize the data exchange.
There are a lot of ways to do this synchronization: a simple method is using G112 function.
When Z32 meets a G112 it does not read the part-program until a complete cycle of PLC has
passed.
G112 cannot be programmed during the radius compensation or when there are unresolved
profile elements.

2.1.61 G113H - G113L - 2-millisecond interpolation


Axes can be interpolated and controlled every 2 milliseconds (previously, the update cycle was
set at 8 millisec).
Attention: the interpolation cycle at 8 mS is an obsolete mode, still supported for compatibility
with systems still operating with this mode. However, the occurrences where the 8 mS cycle are
really useful are very rare.
Instead, there have been cases in which the execution of old macros containing the G113L
instruction (activation of mode 8 mS) has resulted in a malfunction caused by hard-to-diagnose
reasons.
For this reason, G113L effectiveness for systems generated in 2 mS setup has been eliminated,
maintaining it only for systems generated in 8 mS setup.
Two G command the change from 8 to 2 millisec and vice versa.
G113H controls 2 mS
G113L controls 8 mS
It is possible to program already active G113H or G113L (this has no effect)
Upon reset, the axis control mode as defined in the machine calibrations (axis control cycle time
= 2.8 mS) is active by default.
G113H/L can be programmed anywhere in the program even during radius compensation.

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.

2.1.62 G113P - G113F - G113X choosing between proportional, feed-forward and


X MODE movement
Z32 features three interpolation modes:
- The "standard " mode includes feed-forward allowing extremely precise moves (tracking error
values are very low, practically zero even at very high speed).
- The "proportional error" mode has no feed-forward. As a consequence, tracking errors
become rather substantial, but movements are 'smoother' than in normal mode.

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.

G113X is disabled by programming G113F or G113P.

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.

2.1.63 G113X KA1 - interpolation evolution in X MODE


The G113X KA1 function improves and completes G113X interpolation mode (X MODE). With
the introduction of more efficient algorithms for high speed. With G113X KA1, errors in machining
can be reduced to a fraction of those (already very low) obtained with G113X.
It can be programmed with G113X KA1 and requires G114 to have been previously activated.
Before activating G113X KA1, it is necessary for all the axes involved in the movement (i.e. all
live axes) to have been previously calibrated with the G125 KA1 function.
These functions are part of the high speed machining system. For further details, please see the
relevant M146 "High Speed" manual.

2.1.64 G113X KA2 - better X MODE speed/acceleration management


G113X KA2 is a feature improving machining speed and acceleration management as against
G113X KA1. Changes made with this interpolation method generally allow for a better finishing
degree or, if G114 faster dynamic parameters (K = acceleration and J = jerk) are used, a shorter
execution time.
It is activated by simply programming G113X KA2 instead of G113X KA1.
For the rest, it is identical to G113X KA1, namely:
- Axes are qualified with G125 KA1
- G114 is required to be active and G114 parameters are the same
ATTENTION: Since this is a feature that affects many aspects of movement control, it should be
used only if necessary and with the machine manufacturer's or D.Electron's support.
These functions are part of the high speed machining system; for further details, please see the
relevant M146 "High Speed" manual.

2.1.65 G113C - G113N - compensating tool paths for soft movements


G113 has two more functions:
G113C: soft movement compensation enabled
G113N: soft movement compensation disabled
With G113C, a tool-path compensation is introduced. This drastically reduces the shape error
produced by soft movements (G113P or G98).
G113N (enabled at reset) cancels G113C then returns to the previous mode.
These two functions are part of the high speed management system.
For further details please see the relevant M146 "High Speed Machining" manual.

2.1.66 G113A - G113B - G113Z - rounding off


Typical functions of high speed machining (G114)

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.

2.1.67 G113V - G113S - advanced feed management


Z32 is able to manage axes feed in a much more precise way.
Since this advanced feed management requires a large quantity of additional calculations, it can
be carried out only on machines equipped with fast CPUs (486DX4 or Pentium).
Advanced feed management is particularly useful with high speed programs (G114 and part-
programs composed of many small-size segments in G1). However, performances are improved
also in normal mode.
In particular, even when G114 is absent, advanced feed management eliminates slowdown in
G1 caused by very short blocks and optimizes final positioning times, especially on axes defined as
"soft" in machine settings (Ntar higher than 2).
Positioning and slowdown time delays on the edges are substantially shortened with advanced
management although machine movements remain soft.
Advanced feed management is active at reset if it has been defined in the machine settings.
However it can be enabled or disabled by a part program through the use of G113V and G113S.
G113V (modal with stop) activates advanced feed management. Mnemonic G113V = advanced
Programming G113V when advanced management is already active is accepted and has no
effect.
If the CPU declared in the machine settings is not at least a 486DX4 or a Pentium, a
programming alarm is generated:
CN5314 INSUFFICIENT PROCESSING POWER
G113S (modal with stop) disables advanced feed management. Mnemonic G113S = Standard.
Programming G113S when advanced management is already disabled is accepted and has no
effect.

2.1.68 G114 - high-speed machining


Modal
Typical high speed machining function.

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.

G114 and program lines display


The lines of a part program may be subdivided in two cathegories:

A) Operating lines
These are lines doing something, like axes movement, auxiliary functions, etc.

B) Non operating lines


All other lines. They may be empty or comment lines, lines containing only computations, or
value assignment tonumerical parameters, or evolved lines.
The display of a line uses some Z32 operating system resources, shared by G114 for blocks
look ahead.
When G114 has been designed, a situation where each line contains a programmed movement
(normal situation for CAM generated part-programs) was considered.
In the real world, situations where many non operating lines are intersperded with operating
lines are very common. A typical case occurs when Z32 automatically computes curve points, in
very simple or special cases, possibly calling a subprogram containing various mathematical
computations.
The strategy used to display non operating lines is as follows:
- in semiautomatic, non operating lineas are always displayed
- in automatic, both memory and DNC modes, non operating lines are never displayed
With this strategy, G114 operates in the same way, also if subsequent points are computed by
the Z32 using many non operating lines between points. A limit is posed by the computing time,
which must be coherent with the programmed feed and with programmed segment lengths.
G114 and lathes
The function G114 have been designed to execute part-programs composed by a large number
of very short segments, typical of milling machines. This function is not suitable to be used on
lathes. For further information, please ask D.Electron.

68
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

2.1.69 G115 - disable high-speed machining


Modal active at reset.
G115 disables the G114
This function belongs to the High Speed machining system. For further details please refer to
the relevant M146 High Speed manual.

2.1.70 G116 - machining on an inclined plane


Z32 allows machining to be performed on inclined planes using the general performance offered
by permanent formulas. However this solution introduces some usage limits, and this is due to the
permanent formulas.
G116 (roto-traslation on the machining plane) can be programmed on three axes.
The complete format of G116 is as follows:
G116 KA... X... Y... Z... I... J... J... K...
N.B. Only I, J, or K can be programmed in the same line.
The KA parameter selects the function for G116:
- if KA=0, G116 is disabled
- if KA=1, G116 is activated according to the values of X, Y, Z, I, J, and K.
- if KA=2, without additional parameters, it automatically generates the angles needed to
align the orthogonal plane with respect to the spindle. This function is only available with
a general-purpose G117, otherwise a CN2C14 INCOMPATIBLE PARAMETERS error
will ensue.
- if KA has not been programmed and either X, Y, Z, I, J, or K has been programmed, it is
the same as to KA1.
- If none of KA, X, Y, Z, I, J, or K was programmed, G116 is enabled with the same
parameters used for the last G116 programmed. G116 is saved in the permanent
memory (CMOS), therefore it remains there even after the CNC is turned off.
Consequently, if the machine came to a stop with G116 active and the tool inside a
inclined hole, it is possible to turn on the machine again, program G116 without any
parameters in MDI mode, go to Jog mode and extract the tool by sending jog
commands through the buttons.
The X, Y, Z, I, J, and K parameters determine the geometry of G116, which is incremental and
associative.
X, Y, and Z identify the origin of the new axis system defined in the current axis system.
I (or J or K), that can be programmed one at a time, identify the rotation of the new axis system
around the X (or Y or Z) axis in the current axis system.
In other words, G116 introduces a rotation having an angle I (or J or K) around the point whose
coordinates are X, Y, Z in the coordinate system that was valid before programming G116.
I, J and K must be expressed in degrees.
The line containing G116 does not generate any movement.
On the same programming line of G116 it is possible to enter a linear translation motion plus a
rotation: the system will perform first the linear motion and then the rotation in this order.
The position displayed is always referred to the coordinate system rototranslated from G116.
The order according to which G116, KA, X, Y, Z, I, J, and K are programmed is not important.
G116 can be programmed when G116 is already active.
G116 is compatible with G117 and G118 but not with G118HR1, nor permanent formulae, or with
tracing movements (G111).

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

N2 G116 X10 Y20 Z30 0 -10 0 -20 0 -30

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

N10 G116 J90 60 -30 -10 20 50 50

N11 X45 60 45 65 20 50 50

N12 Y50 60 45 65 50 80 50

N13 Z40 50 45 65 50 80 40

N14 G116 K90 50 50 65 -45 80 40

N15 X10 50 10 65 -45 40 40

N16 Y30 50 10 -10 30 40 40

N17 Z60 70 10 -10 30 40 60

N18 G116 K-90 70 -30 -10 10 40 60

N19 X45 Y50 Z40 50 45 65 50 80 40

70
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

N20 G116 KA0 50 50 65 65 80 80

N21 X0 Y0 Z0 0 0 0 0 0 0

N22 G116 0 -20 0 -30 0 -10

N23 X45 Y50 Z40 50 45 65 50 80 40

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.71 G117 - RTCP for rotary head


Modal.
G117 control RTCP (rotation tool centre point) for a spindle head driven by rotary axes. The
head can revolve around a single axis, or around two cascade-coupled axes, i.e. one drive axis and
one idle axis (bi-rotary head).
The general format for enabling G117 is:
G117 [KA] [RA] [I J K]
For a more detailed explanation on the use and on the functioning please refer to the M154
Manual, Rotation (RTCP).

2.1.72 G118 - RTCP for rotary table


Modal.
The special G118 function is used for controlling RTCP (rotation tool centre point) of 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:
G118 N [KA] [RA] [I J K] [X Y Z]
or
G118 axis name [KA] [RA] [I J K] [X Y Z]
For a more detailed explanation on the use and on the functioning please refer to the M154
Manual, Rotation (RTCP).

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

G118 axis name HR1 [KA] [RA] [X Y Z]


For a more detailed explanation on the use and on the functioning please refer to the M154
Manual, Rotation (RTCP).

2.1.74 G118 HR2 - static RTCP for turning table


Modal.
The special, static G118 HR2 function is used for managing the RTCP (rotation tool centre
point) table. G118 HR2 calculates the corrections to be applied to the axes (XYZ) due to the current
position, i.e. the physical dimensions of the rotary axes related to G118 (or table axes).
The resulting effect on G118 HR2 programming is the translation of the workpiece origin
depending on the table axes dimensions. The reference system is not rotated; the linear axes
remain aligned with the machine axes.
After programming G118 HR2, table axis movements related to G118 do not produce passive
motions on linear axes, nor the automatic recalculation of the work piece origin. To recalculate the
origin after a rotation, G118 HR2 must be deactivated (by programming G118 E) and
reprogrammed.
The general format for enabling G118 HR2 is:
G118N HR2 [KA] [RA] [X Y Z]
or
G118 axis name HR2 [KA] [RA] [X Y Z]
G118 HR2 functionality is equivalent to that of G118 S, 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.
For a more detailed explanation on the feature use and functioning, please refer to the M154
Rotation (RTCP) 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

G118S dragging axis dimension [KA] [RA] [X Y Z]


For a more detailed explanation on the feature use and functioning, please refer to the M154
Rotation (RTCP) manual.

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.

2.1.77 G120 - rotary table RTCP coordinates of the table centre


The G120 function is part of the RTCP management system for rotary tables (G118). G120 is in
charge of supplying the coordinates of the table centre to the system, or the coordinates of the
rotation centre.
The programming format is:
G120 [RA] I J K
For a more detailed explanation on the use and on the functioning please refer to the M154
Manual, Rotation (RTCP).

2.1.78 G121 - differentiated scale factors by areas


The G121 function allows the programming of differentiated scale factors, by axis and by area,
only for linear block programming.
Up to four areas can be programmed, and in each area, every axis of the working triad can be
assigned a different scale factor.
For further details please see the description of G121 in the special M155 manual "Differentiated
Scale Factors by Areas".

2.1.79 G122 - compensation of piece assembly error on tilting tables


Modal.

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).

2.1.80 G123 - limit capacity range


With the G123 it is possible to limit the capacity range by programming the measures of the NC-
controlled axes (logic number from 0 to 12).
WARNING
G123 only influences the final measures programmed for linear motions.
This function makes it possible to replace (or test, according to the set
mode) the final measure programmed; the intersection of the motion with
the limit measure is never possible.
For each controlled axis a range can be defined through an upper and a lower limit (also called
positive limit and negative limit), which curb the programmed measure after that all active
transformations have been made (G121, scale factors, etc.).
On turning the machine on, the limits of each NC-controlled axis are set to infinite if negative
and to +infinite if positive.
G123 programming
Syntax:
G123 KA0 disables both the positive and the negative limits
G123 KA1 [X...] [Y...] set positive limits and enables positive limitation; if axes exceed the
range, the CN5514 alarm will ensue
G123 KA-1 [X...] [Y...] set positive limits and enables negative limitation; if axes exceed the
range, the CN5514 alarm will ensue
G123 KA3 alarm mode: if a measure exceeds the range, the CN5614 alarm will
ensue
G123 KA4 restores the standard operation mode; the measures are limited to the
set range
G123 KA5 enables the stop mode; if one or more programmed measures exceed
the set range, it will stop all motions and will only resume them when
all measures have returned within the range.

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.

Notes on the use of G123 KA5


If one or more measures programmed are exceeding the range, the system will stop all motions,
and will only resume them when all measures have returned within the set range. The axes remain
blocked in the last position programmed with all measures within the capacity range. The motions
are resumed when all measures have returned within the set range. When all measures are again
within the capacity range, all axes that have not been stopped in the previous step are considered
as programmed.

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

G0Z200 Z goes to 200


G0Y300 Y goes to 300
G0X50 X goes to 30 even if 50 has been set

Examples of G123 programming and use


EXAMPLE 1%
G0X0Y0Z0
G123KA1X30Y40Z50 positive limits
G123KA-1X-10Y-20Z-30 negative limits
G0X60Y60Z60 measures limited to X=30, Y=40, Z=50
G123KA3 alarm mode enabled
G0X-40 CN5614 G123 QUOTA EXCEEDS LIMITS alarm
M2

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

2.1.81 G124 - enable rotary axes handwheels in G117


G124 makes it possible to enable the handwheels of the rotary axes linked to G117 while G117
is active.
The aim is to allow the operator to move the machines head manually while the workpiece is
being machined in automatic or semiautomatic mode.
With G124 enabled, it is not possible to program the measures of the rotary axes linked to G117
(axis of a standard rotary head, drive/idle axes of a bi-rotary head).
G124 programming
Syntax:

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

G0A30B40X40 A and B can be re-programmed


G124 from now on, A and B can only be moved using the handwheels
G0X10Y15Z25C30 ok (C axis not linked to G117)
G0Z0X0Y0C0 ok
G117KA0 the disabling of G117 also disables G124: A and B can be re-
programmed
G0A15B35X10 ok

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.

2.1.83 G126 - enable machining of a workpiece in motion


Modal, with stop.
This function has been designed for special machines which operate on workpieces in motion.
In these machines, the workpiece is fixtured on a moving conveyor belt (i.e. the master axis)
while the machining unit is stationary and can have various axes, one of which is the tracking axis
(i.e. the slave axis).
G126 enables the tracking mode between the master axis and the slave axis.
Further details about this function are available in the M99 Manual - ML Programmable logic,
FFLOCK function.

2.1.84 G127 - disable machining of a workpiece in motion


Modal, active on reset, with stop.
G127 disables G126, tracking mode.
Further details about this function are available in the M99 Manual - ML Programmable logic,
FFLOCK function.

2.1.85 G128 - G129 - G130 process lock functions


These process lock management functions allow a special operation mode for multi-process
machines with synchronized axes.

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

2.1.86 G131 - constant speed of tool tip


Modal.
This function causes a relative motion between workpiece and tool tip at the F speed that has
been set while RTCP or G132 (cams machining) active; therefore, the speed that must remain
constant and equal to the F value is the speed of the motions programmed for the XYZ axes,
without considering the motions programmed for the rotary axes and the eventual passive motions
that the rotary axes may generate on linear axes.

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.

- The general format for enabling G131 is:


G131 I

- 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

- G131 does not influence G0

- 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.

Note on G131 used with G132 cams machining:


- with G132 KA1 a constant feed for every movement blocks length is obtained, while with G132
KA2 and G132 KA3 the feed will be constant for blocks containing short movements, but it may be

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.

2.1.87 G132 KA1 - globoidal cams machining


The machining of globoidal cams, generated by CAM systems, consists of motions that prepare
the linear and rotary axes, followed by interpolating motions that obtain the cam profile.
Typically, the part-program is generated according to the following procedure:
- the CAM system knows the radius of the tool employed
- the motions that obtain the cam profile are only those of the rotary axes, leaving to the CNC the
task to calculate the linear axes motions in real time in RTCP.
The problem that emerges in production is that the real tool radius can be slightly different from
the radius in the CAM system, and therefore, in order to avoid rewriting the whole part-program with
the CAM system, the CNC must provide the possibility of correcting the tool motions to compensate
for the radius difference: G132 provides the solution to this problem.
The syntax of G132 is the following:
G132 KA1 (axis1)(v1) (axis2)(v2) (axis3)3 (axis4)4 HX(vx) HY(vy)
HR(vr) I(vf)
where:
(axis1) is the name of the first linear axis, e.g. X
(v1) can only assume two values, +1 or -1, to indicate that the compensation must be applied to
axis1 with its original value or with changed value
(axis2) is the name of the second linear axis, e.g. Y
(v2) can only assume two values, +2 or -2, to indicate that the compensation must be applied to
axis2 with its original value or with changed value
(axis3) is the name of the first rotary axis, normally associated to the first linear axis
(axis4) is the name of the second rotary axis, normally associated to the second linear axis
3 and 4 are obligatory values which allow the NC to identify the axes
(vx) is the numerical value which individuates the length in mm of the rotation arm related to the
first rotary axis
(vy) is the numerical value which individuates the length in mm of the rotation arm related to the
second rotary axis
(vr) is the numerical value in mm representing the difference between the radius used by the
CAM system for calculations and the real radius of the tool on the machine; the maximum
admissible difference is 8.192 mm.
(vf) is the maximum speed in mm/min at which the NC moves the linear axes for corrections
For example:
G132 KA1 X1 Z-2 A3 C4 HX11.210 HY120,437 HR-.162 I1000
Introduces a correction for globoidal cams in which:
- X and Z are the linear axes, associated to the A and C rotary axes
- the Z axis correction value is the inverse of the theoretical value
- the A axis rotation arm is 11.210 mm

D. ELECTRON 81
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

- the C axis rotation arm is 120.437 mm


- the real tool radius is inferior to the radius in the CAM system by 0.162 mm
- the maximum correction speed is 1000 mm/min
The correction is disabled with:
G132 KA0
Some notes about the G132 programming syntax:
- KA is obligatory and can only assume the values 1 or 0
- the length and speed values are in mm and mm/min, even though the unit of measure for the
machine is the inch
- if KA1 has been programmed, it will be necessary to enable HX, HY, HR and the four axes
with the values +-1, +-2, 3, 4 respectively
- I programming is optional; if not programmed, I will assume the 500 mm/min default value; if
programmed, its maximum value will be 2000 mm/min
- the elements that make up the line can be entered in whatever order
- all the numerical values can be programmed through expressions; for example, HR<R-10> can
be used for indicating that the CAM radius was 10 mm and therefore the difference is the current
radius R minus the CAM radius
- G132 is not compatible with G53/G54 (error CN3914 <<FORMULA + G53/G54>>)
- G132 is compatible with RTCP and with whatever geometrical segment programmed (linear,
circular etc.)
- with G132 enabled it is possible to program linear axes: the correction value is added to the
programmed motion.
Other details on real-time motion execution procedures:
- when enabling G132, the corrections start from zero and reach the calculated values within a
period which begins with a certain delay (at least 0.25 for a rotary axis) and lasts the time
necessary for reaching the full correction value; then the segment which immediately follows the
G132 should be on air so as not to generate wrong profiles
- when disabling G132 (after G132 KA0) an inverse motion occurs for recovering the correction;
here too, a motion on air is necessary so as not to generate wrong profiles
- during the block search, the correction function is not active; when machining starts again,
there is an initial linkage period (similarly to the G132 enabling procedure)
- during machining the maximum correction speed on each linear axis is limited to the
programmed speed (default value 500 mm/min); if the workpiece geometry requires higher speeds,
the errors can be compensated successively as soon as the axes speeds have returned within the
set limits
- corrections are calculated on the basis of the axis motion direction, and are amplified by the
radius difference programmed with HR; therefore, the surface finish quality not only depends on the
correctness of the programming procedure, but also on the radius difference which should be as
small as possible (far lower than the HR limit, i.e. 8.192 mm)

2.1.88 G132 KA2 - cylindrical cams machining


The CAM generated part-program for the machining of cylindrical cams is composed by
movements computed for a given tool radius; the problem is posed when there is the need to use a

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).

2.1.89 G132 KA3 - polar cams machining


The problem is similar to that of cylindrical cams: the part-program computed by the CAM uses
a given tool radius and a possible problem is the need to use a different radius for the machining,
giving the CNC the possibility to correct the movements taking into account the radius difference.
G132KA3 addresses this problem.
In this case the physical structure is given by a machining on a table plane (for example XY),
rotating around an axis orthogonal to the plane itself (Z if the table plane is XY): the machining on
the plane is executed with movements:

84
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

- of a linear axis (for example Y axis)


- table rotation (for example C axis)
The complete syntax of G132KA3 is the following (supposing the part-program contains
movements for axis1 axis3):
G132 KA3 (axis1) (v1) (axis2)(v2) (axis3)(v3) HX(vaxis1) HR(vr) I(vf)

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).

2.1.90 G133 KA0 KA5 - double spindle and table-spindle management


This feature is reserved to multi-spindle machines and requires support from the machine PLC.
For further details, please consult the machine tool builder.
With G133 KA), the main spindle is activated, with G133 KA1, the auxiliary spindle is activated,
with G133 from 2 to 5, one of four possible table-spindles is activated (table-spindles must be
defined and activated by the machine tool builder, otherwise the alarm CN2C14 INCOMPATIBLE
PARAMETERS is issued).
If no KA is programmed with G133, or if a KA value different from 0 1 2 3 4 5 is programmed,
the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
The G133 cannot be programmed in the same line as G134, otherwise the alarm CN2C14
INCOMPATIBLE PARAMETERS is issued.
If the machine doesnt support multi-spindles, by programming G133, the alarm CN1D14
PROGRAM ERROR is issued.
At reset and program beginning, the main spindle is automatically activated.
The behavior of the abandoned spindle (continues its rotation or stopped) depends from the
machine PLC, please consult the machine tool builder.

86
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

2.1.91 G134 KA0 KA3 - milling machine/lathe machine switching


This feature is reserved to machines with double functionality, milling machine and lathe, and
must be supported by the machine PLC. For further details, please consult the machine tool builder.
Management differences between milling machines and lathes are:
- on milling machines the tool length is specified by the L parameter, valid on the axis
programmed with G43, while for lathes, two parameters exist (at the same time) LX and LZ
correcting the length along the two X and Z axes.
- in activity 4 acquiring the tool length, the tool length L is acquired for milling machines, while
two lengths, LX and LZ, are possible for lathes.
- only for lathes it is possible (with G107) to activate the diameter programming on X axis, and
related origin and length settings in activity 4, by specifying the D character.
- the M6 programming on milling machines also stops the spindle (behaves like if a hidden M5
was programmed), while this is not true for lathes.
With G134 KA0, the milling machine operation is forced, while with G134 KA1, G134 KA2 or
G134 KA3 the lathe operation is forced.
If KA is not programmed, or values other than 0,1,2,3 are programmed, the CN2C14
INCOMPATIBLE PARAMETERS alarm is given.
At reset and program beginning, the milling/lathe functionality defined in machine setup is
automatically restored.
G134 may be programmed more than once in a part-program, either to force or to restore a
behavior different from that specified in machine setup. The situation of forced lathe (i.e. a
machine defined in setup as a milling machine, but forced to behave like a lathe) is special because
it doesnt allow the G107 (diameter programming): the alarm CN1D14 PROGRAM ERROR is
issued, like programming G107 in a milling machine.
The G134 cannot be programmed in the same line as G133, otherwise the alarm CN1D14
PROGRAM ERROR is issued.
- For a milling machine forced to operate as a lathe (G134KA1/G134KA2/G134KA3), G25
cannot be programmed (working triad variation),
- on lathes acting as milling machines (G134KA0) it is possible to set the G25 working tern
necessary for the machining to be executed.
If there is a forced lathe condition and G53 is programmed (e.g. during a tool change to refer
dimensions to base origins), the machine returns a mill, and G53 becomes "with stop". To restore
the lathe operation, G54 cancelling G53 is not enough: G134 KA1 or G134 KA2 or G134 KA3 must
be reprogrammed.
The alarm CN1D14 PROGRAM ERROR is issued if the lathe is activated when every kind of
RTCP is active (G116, G117, G118, G120, G122), or if RTCP is activated when the lathe is active.
The G134 programming provokes also the acquisition of tool length corrections and origins, like
the L (milling) or LX and LZ (lathes) programming on a ISO line.
G113X is canceled on the switching mill-lathe with G134 KA1 or KA2 and restored on
subsequent lathe-mill switching with G134 KA0.
If G114 is disabled while lathe functionality is active, returning to mill behavior, G114 is restored,
and if G113X parameters have been changed during the lathe phase, the new parameters remain
active also in the mill phase.
Operation of G134 KA0
This functionality allows to activate the milling machine operation on systems configured as
lathes.
General programming syntax:

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.

2.1.92 G135 I1 - G135 J1 - advanced management of high speed


Modal.
The G135 features are part of the high speed system (G114 and G113X or G113X KA1 or
G113X KA2). For more details about the characteristics and strategies of use, please refer to the
M146 "High Speed" manual.

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.

2.1.93 G136 - microdwell


This feature is useful to obtain machine stops and dwells of very short duration.
This feature has been developed for laser cutting machines, where laser must be switched on
and off in very short times.

90
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

The general command syntax is:


G136 TT HX
Where:
TT is the dwell time in seconds, maximum 0.5 seconds. If a negative TT is programmed, or if
TT>0.5, the limit value 0.5 is assumed.
HX is a positive or negative number, to be transmitted to the PLC, with a maximum absolute
value of 8,000,000. The purpose of HX is to inform the PLC on the action to be taken (for example
HX=1 to switch-on the laser, HX=0 to switch off). If the programmed value exceeds 8,000,000 the
value sent to the PLC is limited to the maximum. Fractional values of HX are rounded to the nearest
integer.
TT and HX parameters are mandatory on the same line where G136 is programmed; if not
programmed the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
G136 is a function with stop. If programmed in a block with axes movements, it is executed
immediately after the movements, indpendently from its position on the line. Example:
G1 F5000 X100
G136 TT0.002 HX1
is fully equivalent to:
G1 F5000 X100 G136 TT0.002 HX1
or to:
G136 TT0.002 HX1 G1 F5000 X100
In all the above cases, the microdwell commanded with G136 is executed immediately after the
X100 movement.
The G136 function must be supported by the machine PLC. For further details, please consult
the machine tool builder.

2.1.94 G137 - G138 - for single block and block search


After the G137 function (modal without stop, cancelled at RESET and program start), an
instruction block, that must not be interrupted by either the single block or the block search, begins.
This instruction block ends with G138 programming.
In other words, all instructions between G137 and G138 are regarded as a single block, so all
will be performed in the event of single-block execution, and it will not be possible to resume a
block-search execution within a section between G137 and G138.
G138 cancels G137. Also, the line containing G138 is interrupted by the single block even if the
line is not operational.

2.1.95 G139 - concurrent axes


The "concurrent axes" G139 is used in the case of machines with two parallel axes, where the
position of one of the two axes (compensating axis) changes the position of the other axis
(compensated axis) with respect to the work piece being machined.
For example, this is the case when the spindle moves along the Y axis (compensated axis), and
the work piece is on a table that moves along a V axis (compensating axis), parallel to the very Y
axis.
Below, for brevity, the compensated axis will be identified as Y axis, and the compensating axis
as V axis, but G139 acts on any pair of axes appropriately indicated in the machine settings. Please
refer to the machine tool manufacturer's specifications for further details.

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

2.1.96 G141 - G140 - three-dimensional correction of tool radius


Radius correction in the space, G141 Three-dimensional correction of tool radius
With this function it is possible to execute a three dimensional correction of tool radius in a part-
program composed of a series of points.

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

X10 Y5 Z6 I0.707 J0.707 K0 ;correct line


X10 Y5 I0.707 J0.707 ;not correct line: K not programmed
A10 ;correct line; no tern axis is programmed, nor orthogonal vector components
B10 X5 Y10 Z9 I1 K0 ;not correct: orthogonal vector component J not programmed
.....

Deactivation
G141 is deactivated by programming G140, function without any parameter
G141 I2 ;activation
....
G140 ;deactivation

Rules for the G141 usage:


- G141 active is not compatible with G2/G3/G41/G42/G43/G44; if one of these functions is
programmed while G141 is active, the alarm CN7B14 G141 + G43,G44,G41,G42,G2,G3 is issued.
- G141 cannot be programmed more than once if not previously deactivated with G140,
otherwise the alarm CN7B14 G141 + G43,G44,G41,G42,G2,G3 is issued.
- By programming G141 when G2, G3, G41, G42 functions are active, the alarm CN7B14 G141
+ G43,G44,G41,G42,G2,G3 is issued.
- If G141 is programmed without any I, J, K parameters, the alarm CN2C14 INCOMPATIBLE
PARAMETERS is issued
- By programming G141 with I and K parameters, it is mandatory to program K=0 or K=I,
otherwise the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued
- By programming G141KA1 with J and K parameters, it is mandatory to program K=0 or K=J,
otherwise the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued
- All three axes of the chosen tern must exist and be linear axes in order to allow the
programming of G141, otherwise the alarm CN5414 INCONSISTENT MACHINE SETUP is issued.
- If the third axis of the chosen tern is not the axis parallel to the tool, the alarm CN7C14 G141:
TOOL AXIS NOT VALID is issued.
- If movements programmed when G141 is active contain at least a position related to an axis of
the tern, all three components of the orthogonal vector must be programmed, otherwise the alarm
CN2C14 INCOMPATIBLE PARAMETERS is issued.
- G141 may be programmed together with KA, which may assume only the values 0 (spherical
tool) or 1 (toroidal tool), otherwise the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
- By programming G141 KA0, the J parameter must not be programmed, or programmed = 0,
otherwise the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
- In the G141 activation line, if the specified tern is not following G141, the alarm CN1D14
PROGRAM ERROR is issued.

2.1.97 G142 - G143 - tool retraction (RETRACT)


The function G142 (retract) executes a departure of the tool from the workpiece during the
machining, if some special condition handled by the machine PLC happens.

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

- If active, G142 is applied on both feed and rapid movements.


- During a G142 movement, the travel limit management differs, depending if G142K or G142
along a physical axis (X, Y, Z) has been programmed:
if G142X or G142Y,,, or G142Z has been programmed, the applied travel limit management
is the same of JOG movements: if the movement related to the G142 brings the axis outside travel
limits, the CNC automatically limits the movement to the travel limit, without completing it and
without issuing any alarm.
if G142K has been programmed, the movement is executed by activating G117 (RTCP), thus
activating the real time travel limit management. If the programmed movement brings one or more
axes outside the travel limits, this movement is executed up to the first limit encountered, possibly
issuing a CNEx13 alarm.
- If G53 is programmed when G142 is active, the G142 function will be temporarily deactivated
and automatically reactivated on the next G54.
When the movement programmed by G142 has been executed, the CNC issues the alarm
CN7E14 (G142 EXECUTED); this alarm may be cleared only with a reset or a machine shut down.
- In case of process lock (see G128, G129, G130) the G142 on master process forces the same
G142 also on all connected slave processes, in the program section where the lock is active. If the
lock is not active, the G142 on the master process operates normally, without influencing the G142
on the other processes.
- During a process lock, if the G142 is programmed in the part-program of the slave process, the
function is temporarily disabled when the lock is active, and reactivated when the lock is no more
active.
- If NO alarm of CN type is present (excluding CN0013, CN0113, CNEx13, CNFx13) or alarms
type MU, when the G142 becomes active, the movement is always executed.
- If one of the axes interested by G142 is not alive when the function is activated, the axis is
forced alive and restored as not alive at the end of the movement.
- If G142 is temporarily suspended by a G53 when the PLC activates the G142 procedure, the
CNC stops the axes, but the movement related to the G142 is not executed. In this condition the
alarm CN7E14 G142 EXECUTED is anyway issued.

Restrictions and alarms


- If G142 is programmed when the tool is associated to an axis different from X, Y or Z, the CNC
issues the alarm CN7F14 G142: TOOL AXIS NOT VALID.
- If the tool is associated to an axis different from X, Y or Z when G142 is active, the CNC issues
the alarm CN7F14 G142: TOOL AXIS NOT VALID.
- To be able to program G142K .., in the machine settings, a "Management of G117 (RTCP
head)" must be defined as generalised, otherwise the control gives the CN5414 INCONSISTENT
MACHINE SETUP. Please refer to the machine tool manufacturer.
- The line where G142 is programmed cannot contain parameters different from X, Y, Z, K and
F, nor other G functions, otherwise the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
- The line where G142 is programmed may contain only one among X, Y, Z, K, otherwise the
alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
- The displacement value programmed with X, Y, Z or K may vary from -1000mm to +1000mm
(in inches machines, from -39.37 inches to +39.37 inches).

Special retract management with MU or encoder alarms


The normal retract movement (G142) is not executed if CN alarms (excluding CN0013, CN0113,
CNEx13, CNFx13) or MU alarms are present when the function is activated.

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.

2.1.98 G144 - part-program suspension and JOG or handwheel activation


G144 inserted in a part-program allows to suspend its execution (without exiting from the start
status) and to manually move all continuous axes programmed on the G144 line through
handwheels or JOG pushbuttons G144 remains active until the START pushbutton is pressed,
resuming the part-program execution.
Syntax:
G144 axis1 [axis2] ... [axis n]
Only continuous axes are allowed to be programmed on the G144 line, from a minimum of one
axis up to the total number of continuous axes of the process.
G144 if a function with stop.
When G144 is active, only the axes programmed in the G144 line may be moved through
handwheels or dedicated JOG pushbuttons.
Movements commanded with dedicated JOG pushbuttons are executed with a 2 mm/min feed if
the movement selector is on micrometric, while they are executed with the programmed feed, and
corrected with the override (limited to 100%), if the movement selector is on feed or rapid.
By programming anything different from a continuous axis name on the G144 line, the alarm
CN1D14 PROGRAM ERROR is issued.
By programming G144 without any continuous axis, the alarm CN1D14 PROGRAM ERROR is
issued.
G144 suspends the feature OFFSETJOG and restores it when the part-program is restarted by
pressing the start pushbutton (i.e. G144 owns all dedicated JOG pushbuttons also is the
OFFSETJOG feature is active).

2.1.99 G144 KA1 - part-program suspension and JOG activity activation


It is similar to G144.
The difference is that with the KA1, G144 activates a JOG in all respects (as if Esc 4 Enter were
pressed), and then makes the JOG command line available to the operator; this allows the latter to
select the axes and to provide any other setting to the JOG activity.
Syntax:
G144 axis1 [any other axes] KA1 [F feed]
Example:
G144XY KA1 F20000

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).

2.1.100 G145 - stop and go


This function is suitable for water cutting machines.
G145 activates a temporary stop of the axes, but it is not a true stopping function, and, unlike
G112 - a true stopping function - it may be programmed in any point of the part-program, also
during a radius correction or open profiles.
G145 may be programmed only when G113X is active, otherwise the alarm CN2C14
INCOMPATIBLE PARAMETERS is issued.
G145 acts at the end of the previously programmed movement; therefore, if programmed
together with an axis movement, it is executed before the movement contained in the same line.
For program clarity purposes, it is better to program G145 alone.
If the segment at the end of which the G145 stop is programmed is shortened due to the effect
of radius correction, the stop is anyway executed at the end of the segment; if the segment is
skipped because of radius correction, the stop is transferred at the end of preceding segment.

2.1.101 G146 - height control management


G146 is dedicated to the height control for cutting machines.
The KA parameter must be programmed with G146, to define its function:
G146 KA0 deactivates the height control
G146 KA1 activation of height control
G146 KA11 activation of height control with the approach movement without stop
G146 KA2 freezes sensor height

98
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

G146 KA-2 defreezes sensor height


The height control is strictly related to the corresponding PLC management; other programming
rules must be specified by the machine tool builder. For further implementation and usage details,
refer to the related manual M379 G146 - Height control management.

2.1.102 G147 - G148 - movement velocity control


When many axes are interpolating together, the functions G147 and G148 allow to generate the
correct interpolation velocity without the need to recompute and reprogram the feed at every
program line.
The purpose of this feature is that to refer the programmed feed only to some axes, and not to
all those present in the programmed movements.
For example, if F3000 is programmed and the axes whom this feed is related are X and Z (these
axes will be from now on referred as feed master axes) and a movement with XYZAB is
programmed, the actual feed will be computed considering that the trajectory described by X and Z
will be traveled to the F3000 feed, while the other axes will proceed consequently with the block
feed computed in this way.

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

G147 A50 C100

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

Similarly for the C axis, we will have:


DLC = DC * 100 / 57.29578 = DC * 1.74532 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 XY feed master axes XY


G147KA1 A114.59 radius transforming 1 degree in 2 mm
G1F500X100Y150A100 the A axis will not be considered in feed computing becuase it
is not a feed master axis and the movement contains other
feed master axes.
G1F50000Z100A50 in the feed computing the A movement is of 100 mm and not
50 degrees because the G148 is active and the block doesnt
contain any feed master axes.

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

G148XYZA The feed is applied to Z Y Z and A


1 G1X..Y..Z..A.. considered as a rotating axis with
G147A30 radius 30 mm (or inches)
The feed is applied to X Y Z; the A
G148XYZ axis is moved accordingly (respecting
2 G1X..Y..Z..A..
G147A30 its setup values): in this case the
G147 has no effect.

G148XYZA The feed is applied to A considered as


3 G1A.. a rotating axis with radius 30 mm (or
G147A30 inches)
The G147 has no effect on the A axis
G148XYZ because it is not comprised in the
4 G1A.. axes specified in the G148. In this
G147A30 case the feed will be considered as
programmed in degrees per minute.
G148XYZA
5 G1X..Y..Z..A.. Equivalent to case 1
G147KA1A30
G148XYZ
6 G1X..Y..Z..A.. Equivalent to case 2
G147KA1A30
G148XYZA
7 G1A.. Equivalent to case 3
G147KA1A30
Unlike the case 4, in this case (with
G148XYZ G147KA1) the feed is applied to the A
8 G1A.. axis considering its specified rotation
G147KA1A30 radius of 30 mm (or inches), also if the
axis is not comprised in the G148.

102
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

2.1.103 G149 - cylindrical axes management


This feature has been implemented for machines with a rotating axis mounted on a cylindrical
piece, whose axis is coincident with the rotation axis.
On this kind of machines a machining on the cylindrical surface was previously executed by
programming the position of the rotating axis (subsequently cited as A axis).
It is now possible to program a fictitious axis (subsequently cited as Y axis), corresponding to the
linear development of the measure obtained by the rotation of A axis at a distance R from the
rotation axis (cylinder radius). In the subsequent discussion, the Y axis will be called cylindrical
axis).
To enable this feature, please refer to the documentation of the machine tool builder.
The cylinder radius is set trough the G149 function, using the following syntax:
G149 HR.... ; sets the radius dimension in millimeter (also if the machine is defined in inches)

where: HR=radius of the cylindrical piece.


A radius set with the G149 function remains stored also after a system shutdown.
WARNING: at the first startup, before any G149 is programmed, the cylinder radius has a
default value of 1 mm.
NOTE: the G149 function has the only purpose to set the cylinder radius; the programming
activation follows the axis alive/not alive status of the A and Y axes, as described below.
To activate the programming of the cylindrical axis Y or the true axis A, it is necessary to operate
on the alive or not alive status of the axes. The two programming modes are mutually exclusive. In
particular:
A alive Y alive => programming in Y
A alive Y not alive => programming in A
A not alive Y alive => alarm CN1D14 if both A and Y are programmed
A not alive Y not alive => alarm CN1D14 if both A and Y are programmed

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.

The following table explains the syntax of most common operations:

D. ELECTRON 103
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

Starting status Programming Status reached

A alive Y not alive A alive Y alive


G28Y Programming of Y (mm)
Programming of A (degrees)

A alive Y not alive A not alive Y not alive


Programming of A or Y not allowed
Programming of A (degrees) G29A

A alive Y alive A not alive Y not alive


Programming of A or Y not allowed
Programming of Y (mm) G29Y

A alive Y alive A alive Y not alive


G29Y
Programming of A (degrees)
Programming of Y (mm) G28A
(in two different lines)

A alive Y alive Not allowed; to restore the A


programming, it is necessary to
Programming of Y (mm) G28A
deactivate at first Y, then
reactivate A.

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).

2.1.104 G150 - radius correction for lathes


The function G150 allows to set a more easily usable radius correction for lathes.
The G150 must be programmed before the radius correction request G41/G42 and may be
programmed only if the machine is a lathe or a milling machine forced as lathe with G134.
If G150 is programmed when the radium correction is already active or on a non lathe machine,
the alarm CN2C14 NOT COMPATIBLE PARAMETERS is issued.
The parameters associated with G150 are:
- I allowance
- KA choice of orientation and deactivation
The allowed parameters combinations are the following:
G150 I defines only the allowance
G150 KA defines only the orientation
G150 I KA defines both allowance and orientation
The G150 allows to define a virtual tool tip displaced with respect to the tool center in the
direction defined by KA.
To start the discussion related to the tool radius compensation for lathes, it is necessary at first
to define two important points: the theoretical tool tip and the tool center.
In the figure, the point A represents the tool center, or the center of the radiused sector. The
point B represent the theoretical tool tip.

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.

2.1.105 G151 - spindle rough positioning


The spindle rough positioning serves to stop the spindle, orienting it on the corner set with the
HT parameter or on the detector zero, with a movement that never reverses the rotation direction.
The positioning precision is about 10 degrees. If the zero is overcome by more than 10 degrees,
an attempt is made to position on the subsequent zero (the spindle makes another turn without
inverting the rotation).

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).

2.1.106 G152 KA1 - G153 KA1 - save/restore of active origins


The functions G152 KA1 (save active origins) and G153 KA1 (restore the origins saved with the
last G152 KA1) are useful in programming fixed cycles or subprograms needing to change the
active origins (without knowing their names) and restoring them on exit.
G152 KA1 and G153 KA1 are stopping functions.
It is mandatory to program KA1: if KA is programmed with a different value, the alarm CN2C14
NOT COMPATIBLE PARAMETERS is issued.
If G153 KA1 is programmed without having previously programmed G152 KA1, the error
CN1D14 PROGRAM ERROR is triggered.
The G152 KA1 may be programmed more than once without any programming of G153 KA1; in
this case the saved origins are stored in a special memory space allowing to store up to seven
levels.
If more than 7 levels are used, the error CN1D14 PROGRAM ERROR is triggered.
Warning: G153 KA1 restores the origins saved with the last G152 KA1 executed. it is very
important that the programmer be aware that each G152 KA1 be coupled with a
corresponding G153 KA1, paying special attention on program loops, jumps or other
conditions which may alter the right programming sequence.

2.1.107 G154 - block search with length


The G154 is used to search a block based on length, mainly used on metal sheet cutting
machines (laser or plasma).
The length traveled after a G154 is stored in real time in a retentive memory, and it is available
for a subsequent block search with length, also after a sudden power loss.
The main characteristics of the G153 are:
- non stopping function (may be programmed anywhere in the part-program)
- needs no parameters
- may be programmed more than once in a part-program, in order to allow a quick search from
the supervisor
The G154 allows to achieve a better safety in the block search with length, due to the fact that
the length of the first movement executed in automatic is dependent from the initial physical position
of the axes, which may be any.
Normally the G154 should be programmed immediately after reaching a known point (otherwise
the subsequent block search may find an undefined point, depending on the machine initial
position). For example, on a machine with two axes XY:

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).

2.1.108 G155 - raster functionality


The function G155 (raster feature) is dedicated to laser cutting machines. This functionality is
strictly connected to the characteristics of the machine tool and must be supported by the PLC; it is
therefore to be used following the specifications of the machine tool builder.
This feature allows to solve the problem posed by the etching of letters or figures on a plane
surface lying on a plane described by two axes of the machine.
The etching zone, called raster area, is defined by the coordinates of 4 points (bottom left,
bottom right, top left, top right) delimiting it.
The raster area is subdivided in N rows, equidistant in the vertical direction, and M columns,
equidistant in horizontal direction.
The intersection between the N rows and the M columns generates a grid of NxM points
equidistant on each horizontal row and on each vertical column.
Each point of the grid represents the center of a segment to be etched by the laser.
The laser etching is done during horizontal movements traveling the various rows of the raster
area.
Starting from the coordinates of the 4 points delimiting the raster area, the coordinates of each
point to be etched are computed based on the number of rows N and the number of columns M.
A file with a length of NxM bytes, so called the raster file, contains in each byte the percentage of
the segment to be etched by the laser (a segment is the distance between points on an horizontal
row), centered on a given point of the raster area.
The correspondence between bytes of the file and points of the raster area is the following: the
first byte corresponds to point P1 (bottom left), the second, the subsequent poin on the same row,
and so on.
The dimension of the raster file is NxM bytes.
The G155 allows to execute a laser etching as described above.

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

ZFP[2] 2 (lift in mm for unidirectional passes)


ZFP[3]1 (flag 0=bidir, 1=unidir)
ZFP[4]0 (X P1)
ZFP[5]0 (Y P1)
ZFP[6]25 (X P2)
ZFP[7]0 (Y P2)
ZFP[8]0 (X P3)
ZFP[9]20 (Y P3)
ZFP[10]25 (X P4)
ZFP[11]20 (Y P4)
ZFP[12]200 (number of rows: P1-P3 and P2-P4)
ZFP[13]250 (number of columns: P1-P2 and P3-P4)
ZFP[14]10 (Z working position)
G155 HX1 C:\Z32\PPG\FILE.RST (raster file)
F50000 (traveling feed)
!GOP201! (calls the G155 macro)
G155 HX0 (deactivates the G155)
M2

2.1.109 G156 - graphic display management for lathes


The G156 function, for lathe machines, allows to set two offsets for the first and the second axis
of the working tern, in order to move the displayed area in the real time graphic and in the graphic
execution or geometric simulation.
It is a modal function with stop.
If the function is programmed on a milling machine, the alarm CN2C14 (not campatible
parameters) is triggered.
Activation syntax:
G156 HX... HY...
where HX defines the offset for the first axis of the tern, and HY the offset for the second axis.
Deactivation with:
G156 KA0
In the activation line both the HX and HY parameters are required, otherwise the alarm CN2C14
NOT COMPATIBLE PARAMETERS is issued.
The G156 function must be considered as reserved to D.Electron for the development of
dedicated graphical interfaces for lathes.

2.1.110 G157 HX - for connection between part-program and fast-codos


The G157 is a non stopping function and must be joined with the HX parameter in the
programming line.

D. ELECTRON 111
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

The G157 HX is dedicated to software programmers of supervisors or external CAM/DNC


programs.
It allows the in line synchronization of an external CAM with the part-program execution and
the access to the Z32 internal data (for example, the value of the parameters programmed),
avoiding the effect of the look-ahead buffer.
The HX parameter programmed together with G157 is stored in real time and can be read by
fast-codos (see manual M211) type 16, wnd=66.
The data read is the value of the programmed HX parameter, rounded to the nearest integer.
A possible use of G157 by an external CAM generating the part-program to be executed in-line
and in real time, is the following:
- the CAM generates and transmits in DNC all the part-program lines not needing to access any
Z32 internal parameter
- when the CAM needs some Z32 data, it generates a line containing G157 HX where the
value of HX is always incremented, in order to obtain unique identifiers
- after this line, the CAM stops the DNC transmission, and checks (through the fast-codos
command 16.66) the value assumed by the G157 parameter in memory
- when the value read is identical to the last programmed value, it is certain that Z32 has read all
the lines and that the parameters in memory are updated to the last line
- at this point the CAM may read the needed data (for example with commands 17, various
wnd), continue with the part-program generation and its transmission in DNC.
Because the G157 is a non stopping function, the look-ahead buffer normally contains enough
segments to be interpolated, allowing the whole described synchronization process in masked time,
without provoking any slowdown of the machine movements.

2.1.111 G158 - G159 - forcing of cyclic/non cyclic axis


These functions are dedicated to the implementation of system macros and must be used
carefully by skilled programmers.
G158 (followed by an axis name) forces a cyclic axis. Example:
G158W forces the axis W as cyclic
G159 (followed by an axis name) forces a non cyclic axis. Example:
G159V forces the axis V as non cyclic
Other information:
- G158 and G159 are modal, stopping functions
- at reset, the setup conditions are restored
- HX and HY cannot be programmed in the same line as G158 or G159, otherwise the alarm
CN2C14 - NOT COMPATIBLE PARAMETERS is issued.

2.1.112 G160 - to limit the axes and spindle speed


Function with stop.
Possible formats:
G160 KA0 (restores setting conditions)
KA cannot be programmed with a value other than 0, otherwise the CN2C14 INCOMPATIBLE
PARAMETERS error is displayed

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).

2.1.113 G161 - reserved for the simulator


G161 is a part-program "G" reserved for the D.Electron simulator software for internal use.

2.1.114 G163 - synchronised tapping, with spindle position control


The function for rigid tapping has only been G63 so far.
With this function (G63), the spindle inversion is controlled the instant in which the tapping
movement goes beyond the programmed dimension, therefore a longer movement (overshoot)
occurs due to the spindle braking ramp.
This overshoot can be compensated by calculating the braking time and programming a shorter
movement, but it is not always easy to predict the spindle ramp, especially if there is a second
acceleration limitation (jerk), therefore the resulting precision is never very high.
A new rigid tapping function, G163, has thus been introduced. It can be programmed, for
example, with:
G163 K1 Z-20
The programming mode is identical to that of G63, but with G163 the spindle ramp is
automatically calculated and controlled by the CN, so that the movement stops exactly at the
programmed position.
It is thus no longer necessary to program a shorter travel.
The achievable accuracy depends on many factors, among which the dynamics of the spindle,
the tapping pitch and the requested inversion speed: it can vary between a few millimetre
hundredths and a few millimetre tenths.
G163 also supports the return speed (thread output) different from the input one. For example:
G163 K1 Z-20 I2
The I2 parameter, programmed in the same line as G163, requires a spindle speed two times
higher than the input speed.
I (optional) is the multiplier to be applied to the spindle speed during output.
The permissible range for I is 0.5 to 4. Values outside this range are not accepted and the output
speed is the same as the input speed.
G163 can also perform synchronised, deep tapping with chip breakage. The J parameter
programmed in the same line as the active G163 enables the synchronized deep tapping feature.
The programming generalised syntax for G163 then is:
G163 XYZ K [I] J [HX]

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.

2.1.115 G164 - compensation for a particular type of chatter


This feature allows deleting a particular type of chatter finishing, in particular on milling machines
with rotational heads provided with torque motors.
As this is a still an experimental feature presently having operational limitations that prevent its
general use, no precise details are available.
If necessary, consult D.Electron.

114
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

2.1.116 G200 HX0 / G200 HX1 - DNC mode setting


In Z32 setup data, the setting of DNC mode is considered; this setting may be of "$%" type or
"COTERM" type.
The $% type receives data with a very simple protocol through serial line A (see manual M161).
The COTERM type contains all other modes, starting from the protocol through serial line B, to
internal Z32 modes, used by the various support programs (ZTERM, TERMS, DIGIT).
In some cases, the user need both modes.
With the G200 function, the mode may be changed; the function may be issued by part-program
or in semiautomatic mode:
G200 HX0
arranges the $% mode
G200 HX1
arranges all other modes
The function G200 is transparent at reset. Once programmed, it remains active until a new G200
is programmed.
On system startup, the mode defined in setup is arranged.
If HX is not programmed on the same line, an incompatible parameters alarm is issued.

2.1.117 G200 HX2 / G200 HX3 - inversion kick deactivation


When the velocity sign is inverted on one axis, a lost motion is generated, i.e. instead of
immediately resume the motion in opposite direction, the axis remain still for some time.
One method used to solve this problem is a special machine setup called inversion kick: when
the axis must invert its movement direction, the CNC sends to it a supplementary command
accelerating the inversion.
This supplementary command may be harmful in case of very slow inversions, like those
encountered with very big circle radiuses or executed at low speed, or with almost plane profiles.
In this case the kick effect are movements slightly out of path (magnitude order of 0.01 mm,
depending on the machine dynamics) capable to mark the workpiece surface.
It is possible to deactivate the inversion kick, by programming in the part-program:
G200 HX3 (disables inversion kick)
If in the same part-program the kick must be reactivated, program:
G200 HX2 (enables inversion kick)
Both functions are modal, stopping functions.
At RESET and program beginning, the inversion kick is always enabled.

2.1.118 G200 HX4 / G200 HX5 - complete circle programming


The execution of the following line inside a part-program:
G200 HX4
forces the execution of a complete circle on the following lines, when the circle arc is
programmed with G2/G3 I J X Y and final positions identical to starting positions.
The effect of G200 HX4 is modal. i.e. is active on all subsequent lines until a possible
deactivation with G200 HX5.

D. ELECTRON 115
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

Conditions for the execution of a complete circle are:


- the circle must be programmed with G2/G3 I J X Y
- final positions must be identical to initial positions
The effect of G200 HX4 is canceled by programming:
G200 HX5
A special machine setup exists (consult the machine tool builder) forcing the complete circle at
program start, thus avoiding the need to program G200HX4. If this setup is active, it may be
deactivated with G200 HX5.
For the complete circle programming, see also the paragraph on geometry.

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.121 G200 HX10 - timed G113X KA1 enable


The feature G113X KA1 (high precision axes control) is a special option subject to a special
license; if programmed on machines without license, the alarm CN7814 SOFTWARE OPTION
NOT ENABLED is issued.
In order to allow the user the possibility to test the feature, it is possible to activate the option for
a total 30 minutes period, by programming G200 HX10 in the part-program.
If the machine is licensed, G200 HX10 has no effect.
If the machine is not licensed, after a total 30 minutes working time is elapsed with G113X KA1
active, the alarm CN7814 is issued.
WARNING: the alarm may be issued also during the machining of a workpiece; use this
feature only for test purposes.
The 30 minutes period is a total machining time; it is not influenced by RESET, program change,
etc. When the period is elapsed, G113X KA1 cannot be used again.
The 30 minutes test period is restored only with a On/Off power cycle of the machine.

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.125 G200 HX17 / G200 HX18 - circle programming tolerance


A circle can be programmed, starting from a previously defined point, with a centre and an end
point.
If the programmed geometry is perfect, the previous point (from which the circle is started) and
the end point are at the same distance (equal to the radius) from the centre of the circle.
If the geometry is not perfect, however, the radius identified by the previous point and the one
identified by the end point are different, and a positions step is generated.
Above a certain tolerance (about 0.06 mm), the CN does not accept the profile and generates a
CN4614 PREVIOUS POINT NOT ON CIRCLE alarm.
There are, however, some applications in which the precision with which the CAM provides the
profiles is poor, and the standard tolerance (0.06 mm) can be exceeded.
It is possible to extend tolerance by about 4 times (errors of up to about 0.25 mm are therefore
permitted) by programming:
G200 HX17
G200 HX17 effect is transparent at RESET and program start (i.e. once programmed, it remains
until shutdown).
Attention: G200 HX17 can be defined as permanent at power on (this makes its effect
permanent already at the machine startup). For this feature, please consult the machine tool
builder.
A standard lower tolerance can be achieved by programming:
G200 HX18
It is up to the programmer to evaluate whether a higher tolerance is compatible with the machine
characteristics.

2.1.126 G201 - dynamic structure behavior analysis


The function G201 is dedicated to the study of dynamic behavior of mechanical transmissions.
This function is reserved to D.Electron to be used in its diagnostic tests.
The function must not be programmed during normal operation.

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

- return to the line N1


- calculation of the end point, obtained from the XY programmed, displaced by a radius in a
direction orthogonal to the profile. In the example, the end point is X10 Y7 (G241 radius
correction with tool on the left, radius R=2, initial slope of the future profile zero, horizontal
segment)
- execution of a G1 movement to the calculated end point
- part-program continuation
Supplementary notes:
- G241/G242 must be coherent with the future radius correction (G41/G42. Z32 doesnt make
any coherence check: if the parameters are not coherent, the radius correctionis applied in a
wrong direction.
- The profile initial point must coincide with the point programmed with G241/G242
- the first movement of the profile may be any, but it must be a solved segment (with an
explicitly programmed end point)
- if the first movement of the profile is on a circle, the point programmed with G241/G242
must stay on the circle
- in the blocks between G241/G242 and the start of radius correction, other XY movements
may be included, but when the radius correction is started the position must return to that
programmed with G241/G242, otherwise the correction is not correctly applied.

2.1.128 G410 - G420 - lathe tool anti-gouge floating


Functions G410 and G420 are used to enable shadow areas monitoring when making a radius
correction profile on a lathe machine. This feature will be hereafter referred to as "Tool anti-gouge
floating."
The feature must used with typical lathe tools for profile machining.
Requirements for programming G410/G420:
- The G150 function defining the tool direction must be programmed with one of the following
guidelines:
G150 KA1 or G150 KA3 or G150 KA5 or G150 KA7

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

2.1.129 G800 - G801 - G802 - on-disk canned cycles and macros


WARNING: The usage of the G800, G801, G802 is reserved to D.Electron for the
implementation of fixed cycles and macros. In order to avoid possible conflicts, avoid to use
this codes to implement proprietary fixed cycles and macros.
These functions are dedicated to the management of canned cycles and macros residing on
disk. In particular:
G800 (on-disk canned cycles management), G801 (on-disk positioning macros management),
G802 (on-disk machining macros management).
With this feature it is possible to recall Z32 macros and canned cycles, stored on the computer
hard disk, from a part-program.
The disk folder where these files are stored is C:\Z32\MACRO.

D. ELECTRON 123
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

File names are coded as follows:


C1, C2......, Cn are canned cycles
P1, P2..., Pn are positioning macros
M1, M2...., Mn are machining macros
The functions allowing to call on-disk canned cycles and macros are the following:
G800 Kn recalls the canned cycle Cn
G801 Kn recalls the positioning macro Pn
G802 Kn recalls the machining macro Pn
The following paragraphs describe in more detail these three G functions.

G800 (on-disk canned cycles management)


The G800 function recalls and activates a canned cycle. The complete syntax is as follows:
G800 [MHA..][MHZ..] [NA..][NZ..] [E..] [I..] [J..] [KA0] [KA1] [KA2]
[K0] [F..] (...)
where:
Kn = (1<=n<=9999, integer) recalls the canned cycle Cn: Z32 reads from the disk the file Cn
inside the folder C:\Z32\MACRO, loads it in subtemp 65 and activates it (with an implicit G27S65).
The canned cycle is always deactivated with G27C0 or G800K0.
If a canned cycle is called while another is active, the first cycle is canceled and overwritten with
the second.
MHA-MHZ = 26 float parameters, copied in ZFP[550]-ZFP[575]
NA-NZ = 26 float parameters, copied in ZFP[550]-ZFP[575]
These two groups of three letters and two letters parameters are perfectly equivalent, they are
not allocated in the Z32 memory with their programmed values, but their value is simply transferred
in the corresponding ZFP[ ] parameters; parameters not programmed have no effect on the
corresponding ZFP[ ]. If programmed two times (for ex. MHA.. and NA..) the last, i.e. the rightmost
on the line, prevails.
E, I, J = 3 single letter float parameters, respectively copied in ZFP[576]-ZFP[578].
ZFP[550]-ZFP[599] are reserved for G800, but at this time, ZFP[576]-ZFP[599] are not used.
KA0 = resets all ZFP[550]-ZFP[599] parameters
KA1 = the function G800 KA1 may be only programmed inside a macro activated with G881-
G899 or with G901-G999. The AA, AB, AC parameters optionally programmed will be associated
not to the three axes of the active G25 tern, but to the axes programmed (in that order) on the line
containing G881-G899 or G901-G999, in its turn calling the macro where G800 KA1 is
programmed.
KA2 = the function G800 KA2 may be only programmed inside a macro activated with G881-
G899. The AA, AB, AC parameters optionally programmed will be associated not to the three axes
of the active G25 tern, but to the axes programmed with the last G881-G899 programmed together
with one or more axis name. The association order is the same as the axes programming in the
G881-G899 line: AA to the first axis, AB to the second, AC to the third.
K0 = deactivates the fixed cycle and resets all ZFP[550]-ZFP[599] parameters
F = the feed programming is allowed, parameter F.
() = comments are allowed on the program line.
G800 may be programmed in 6 different modes:
G800 Kn [MHA.. MHD..]

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.

G801 (on-disk positioning macros management)


The function G801 recalls and executes a positioning macro. The complete syntax is the
following:
G801 [Kn] [MPA..][MPZ..] [NA..][NZ..] [E..] [I..] [J..] [KA0] [F..]
(...)
where:
Kn = (1<=n<=9999, integer) reads from the disk the file Pn inside the folder C:\Z32\MACRO,
loads it in subtemp 66 and activates it (with an implicit !GOS66).
G801 nesting is not allowed.
MPA-MPZ = 26 float parameters, copied in ZFP[600]-ZFP[625]
NA-NZ = 26 float parameters, copied in ZFP[600]-ZFP[625]
These two groups of three letters and two letters parameters are perfectly equivalent, the
parameters are not allocated in the Z32 memory with their programmed values, but their value is
simply transferred in corresponding ZFP[ ] parameters; parameters not programmed have no effect
on the corresponding ZFP[ ]. If programmed two times (for ex. MPA and NA), the last, the
rightmost on the line, prevails.
E, I, J = 3 single letter float parameters, respectively copied in ZFP[626]-ZFP[628].
ZFP[600]-ZFP[649] are reserved for G801, but at this time, ZFP[626]-ZFP[649] are not used.
KA0 = resets all ZFP[600]-ZFP[649] parameters
F = the feed programming is allowed, parameter F.
() = comments are allowed on the program line.
G801 may be programmed in 3 different modes:
G801 Kn [MPA.. MPD..]
updates all ZFP corresponding to programmed parameters, reads from disk the Pn macro, loads
it in subtemp 66 and recalls it, starting its execution
G801 KA0
clears all parameters reserved to G801: ZFP[600]-ZFP[649]
G801 [MPA.. MPB..]
updates all ZFP corresponding to programmed parameters
Rules and limits:
- if other parameters, different from those listed above (G, M etc....), are programmed in the
same line as G801, the alarm CN1D14 PROGRAM ERROR is issued
- G801 must be programmed at the beginning of the ISO line, only the line number and/or blank
characters may precede it
G801 K1 MPB100 correct programming
G801 K1 MPB100 correct programming
K1 G801 MPB100 program error (CN1D14)
- if KA0 is programmed, no other parameter can be programmed on the line, otherwise the
alarm CN1D14 PROGRAM ERROR is issued:

126
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

G801 KA0 correct programming


G801 KA0 MPA100 program error (CN1D14)
G801 K1 KA0 program error (CN1D14)
- the value of E, I, J, NA-NZ and MPA-MPZ parameters may be expressed with a number or with
a valid Z32 expression (all E, I, J, NA-NZ and MPA-MPZ are Z32 float)
- 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
- 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 positioning macro called through G801, the lines of the macro
are not displayed.

G802 (on-disk machining macros management)


The function G802 recalls and executes a machining macro. The complete syntax is the
following:
G802 [Kn] [MMA..][MMZ..] [NA..][NZ..] [E..] [I..] [J..] [KA0] [HX..]
[ContinousAxesNames..] [K0] [F..] (...)
where:
Kn = (1<=n<=9999, integer) reads from the disk the file Mn inside the folder C:\Z32\MACRO,
loads it in subtemp 67 and activates it (with an implicit !GOS67).
A machining macro called as a fixed cycle is deactivated with G27C0 or G802K0.
G802 nesting is not allowed.
MMA-MMZ = 26 float parameters, copied in ZFP[650]-ZFP[675]
NA-NZ = 26 float parameters, copied in ZFP[650]-ZFP[675]
These two groups of three letters and two letters parameters are perfectly equivalent, they are
not allocated in the Z32 memory with their programmed values, but their value is simply transferred
in the corresponding ZFP[ ] parameters; parameters not programmed have no effect on the
corresponding ZFP[ ]. If programmed two times (for ex. MMA.. and NA..) the last, i.e. the rightmost
on the line, prevails.
E, I, J = 3 single letter float parameters, respectively copied in ZFP[676]-ZFP[678].
ZFP[650]-ZFP[699] are reserved for G802, but at this time, ZFP[679]-ZFP[699] are not used.
KA0 = resets all ZFP[650]-ZFP[699] parameters
K0 = deactivates the fixed cycle and resets all ZFP[650]-ZFP[699] parameters
F = the feed programming is allowed, parameter F.
() = comments are allowed on the program line.

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.

2.1.130 G880G899 - G900 G999 - on-disk canned cycles and macros


WARNING: The usage of the functions G880G899, G900G999 is reserved to D.Electron
for the implementation of fixed cycles and macros. In order to avoid possible conflicts,
avoid to use this codes to implement proprietary fixed cycles and macros.
The functions G880G899, G900G999 are dedicated (as G800, G801, G802) to the handling
of fixed cycles and macros residing on the disk. In particular:
G880G899 (fixed cycles from disk), G900G999 (machining macros from disk).
With this functions it is possible to recall Z32 macros and canned cycles, stored on files of the
computer hard disk, from a part-program.
The disk folder where these files are stored is C:\Z32\MACRO.
The files on disk have the same name as the corresponding G function and are coded:
G881, G882.... G899, are canned cycles
G901, G902. G999, are machining macros
The following paragraphs describe in more detail these G functions.

G880G899 (on-disk canned cycles management)


The functions G880, G881,G899 have a functionality equivalent to G800. In particular:
G880 is equivalento to G800 K0 (deactivates the fixed cycle and resets the associated ZFP[ ]
parameters)
Alike G800, G881G899 are used to activate fixed cycles: these cycles are contained in on disk
files, in the directory C:\Z32\MACRO and are named with the corresponding G function used to call
them (i.e. G883 activates the file C:\Z32\MACRO\G883).
The parameters allowed for G881G899 are the same parameters usable with G800:

D. ELECTRON 129
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual

MHAMHZ, NANZ, E, I, J, K, KA0, F, ()


With G881G899 the K parameter is used as a single letter floating parameter and may be
assigned with a number or a Z32 valid expression. Therefore, the single letter parameters become
4: E, I, J and K copied in ZFP[576]-ZFP[579].
The code K0 is not allowed; it is implicit with G880.
It is possible to program up to three continuous axes names among those defined on the
machine.
The complete programming syntax is:
G881G899 [MHAMHZ] [NANZ] [E] [I] [J] [K] [KA0]
[ContinuousAxesNames] [F..] (...)
With the programming of G881G899 the following values are stored in the parameters
ZFP[701-ZFP[712]:
ZFP[701] = actual position of first axis of G25
ZFP[702] = actual position of second axis of G25
ZFP[703] = actual position of third axis of G25
ZFP[704] = programmed position of the first G25 axis with G881G899
ZFP[705] = programmed position of the second G25 axis with G881G899
ZFP[706] = programmed position of the third G25 axis with G881G899
ZFP[707] = actual position of the first axis programmed with G881G899
ZFP[708] = programmed position of the first axis programmed with G881G899
ZFP[709] = actual position of the second axis programmed with G881G899
ZFP[710] = programmed position of the second axis programmed with G881G899
ZFP[711] = actual position of the third axis programmed with G881G899
ZFP[712] = programmed position of the third axis programmed with G881G899
NOTE: the parameters ZZFP[701]ZFP[712] are updated each time a G880G999 function is
programmed and are maintained up to the next programming of G880G999 (on each G880G999
all these parameters are cleared and then reinitialized with the values programmed on the line).
The canned cycle activated is handled exactly in the same way as with the G800 activation.

G900G999 (on-disk machining macros management)


The functions G900, G901,G999 have a functionality equivalent to G802. In particular:
G900 is equivalento to G802 K0 (deactivates the fixed cycle and resets the associated ZFP[ ]
parameters)
Alike G802, G901G999 are used to activate fixed cycles: these macros are contained in on
disk files, in the directory C:\Z32\MACRO and are named with the corresponding G function used to
call them (i.e. G903 activates the file C:\Z32\MACRO\G903).
The parameters allowed for G901G999 are the same parameters usable with G802:
MMAMMZ, NANZ, E, I, J, K, KA0, HX0, HX1, F, ()
With G901G999 the K parameter is used as a single letter floating parameter and may be
assigned with a number or a Z32 valid expression. Therefore, the single letter parameters become
4: E, I, J and K copied in ZFP[676]-ZFP[679].
The code K0 is not allowed; it is implicit with G900.
It is possible to program up to three continuous axes names among those defined on the
machine.

130
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions

The complete programming syntax is:


G901G999 [MMAMMZ] [NANZ] [E] [I] [J] [K] [KA0] [HX..]
[ContinousAxesNames] [F..] (...)
When programming a G901G999, the following values are stored in the ZFP[701]-ZFP[712]
parameters:
ZFP[701] = actual position of first axis of G25
ZFP[702] = actual position of second axis of G25
ZFP[703] = actual position of third axis of G25
ZFP[704] = programmed position of the first G25 axis with G901G999
ZFP[705] = programmed position of the second G25 axis with G901G999
ZFP[706] = programmed position of the third G25 axis with G901G999
ZFP[707] = actual position of the first axis programmed with G901G999
ZFP[708] = programmed position of the first axis programmed with G901G999
ZFP[709] = actual position of the second axis programmed with G901G999
ZFP[710] = programmed position of the second axis programmed with G901G999
ZFP[711] = actual position of the third axis programmed with G901G999
ZFP[712] = actual position of the third axis programmed with G901G999
NOTE: the parameters ZZFP[701]ZFP[712] are updated each time a G880 G999 function is
programmed and are maintained up to the next programming of G880G999 (on each G880G999
all these parameters are cleared and then reinitialized with the values programmed on the line).
The called macro is handled exactly in the same way as a macro called with G802.
Unlike G802, a G901G999 can be programmed inside a macro retrieved by another
G901G999. Only one nesting depth is allowed, and if it is exceeded, a CN1D14 error occurs (i.e. it
is not possible that the macro retrieved by a G9xx, which in turn is in a macro invoked by a G9xx,
contains a line in which another G9xx is programmed).
Example:
macro G901: macro G902: macro G903:
G0X0Y0Z0 G0X10Y20Z20 G0X20Y30Z40
G1F5000X100 G1F9000Y100 G1F7000Z100
........... ........... ...........
G902 G903 ...........
........... ........... ...........
G26 G26 G26
a G901 is programmed in a part-program. This in turn retrieves the G902 macro, which causes
a CN1D14 error at the time when it invokes the G903 macro.
Moreover, programming a G9xx inside a macro invoked by another G9xx has the following
peculiarities, as compared to a non-nested G9xx:
- By programming a nested G9xx , the ZFP[701] ZFP[712] parameters are not changed
- Neither HX1 nor HX0 can be programmed, otherwise error CN1D14 occurs
- The names of continuous axes cannot be programmed, otherwise error CN1D14 occurs
- Parameters AA, AB, AC cannot be programmed, otherwise error CN1D14 occurs
For the rest, non-nested G9xx programming rules apply.

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. M FUNCTIONS - FEED - SPEED - ORIGINS - PARAMETERS

3.1 AUXILIARY M FUNCTIONS


The auxiliary M functions concern the behaviour of the machine tool and their effects are mainly
defined by the manufacturer.
All the M functions request stop (see chapter on Preparatory G Functions, paragraph G
Functions).
M0==M00 ISO standards indicate the functions of various Ms: only some Ms are decoded and managed
by the Z32 and these we shall describe in detail.
The numeric value (two integer figures) following the letter M indicates what M has been
programmed. Leading zeros can be omitted.
The M functions are sent to the PLC together with any other function comprised in the line, as
will be seen in the specific chapter (Execution ISO Line).
M functions are executed in the following sequence:
- spindle rotation (M3, M4)
- special M (M6 not included)
- other M functions
- indexing or stop spindle (M19, M5)
- tool change (M6)
- final M (M0, M1, M2)
In the same line can be programmed:
- all the M functions decoded by Z32 (M3, M4, M5, M6, M7, M8, M9, M19)
- one of the final M functions (M0, M1, M2)
- another M function, not included in the previous ones.
For example, it is allowed to program in the same line:
M3 M7 M8 M19 M2
The CNC will execute the command, regardless of the order with which the M functions are
entered in the line, except for other intermediate operations (such as axes movements, if
programmed), in the following order:
- spindle on (M3)
- coolant no. 1 and no. 2 delivery (M7 M8)
- stop coolants and spindle indexing (M19)
- end of program (M2)

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.2 AUXILIARY MA, MB, MC FUNCTIONS


Besides the auxiliary M functions prescribed by the ISO standards, Z32 features another three
auxiliary functions (MA, MB, MC) to be sent to the PLC and that are at the disposal of the machine
tool manufacturer for particular functions.
As parameters, the MA, MB, MC functions can be programmed with 9 significant digits before or
after the decimal comma or point.
When sent to the PLC that performs the specified functions, the decimals are lost and any value
higher than 9999 becomes 9999, which means that only 4 integer digits are significant.
The sign of MA, MB, MC can also be programmed. The sign is sent to the logic as a 8000 value
of the programmed function.
Therefore, the following are equivalent:
MA-100 MA8100
MA-1 MA8001
MB-1040 MB9040
The 0 value cannot have a negative sign (MA-0 is the same as MA0 and not MA8000).
The use of the sign depends on the particular function assigned by the machine tool
manufacturer to MA, MB, and MC.
MA, MB, and MC require a stop (please see chapter Preliminary G functions, paragraph G
functions).

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.

3.5 AXES DIMENSIONS


If the address is a name identifying an axis, then the CNC reads the following value as a
dimension regarding the specified axis.
Axis names are defined in the machine settings: they may consist of one or more characters
(two letters axes), the axis identification (first charcter) may be chosen among the following letters:
A B C D H P Q U V W X Y Z

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.

3.6 AXES WITH TWO LETTERS NAMES (NUMERIC INDEX)


The axes programming with a two letters name iis available only on machines where this feature
is enabled.
To get an easier identification of the axes in very complex machines, it has been introduced the
possibility to associate a numeric index to the letter identifying one axis (for example, axis X1, X2,
Y3, etc.).
The numeric index must be in the range from 1 to 9 (index 0 is reserved).
In order to avoid some syntactic incoherencies, the complete axis name must be programmed
by inserting an underscore _ character between the identification letter and the numeric index (for
example X_2).
Furthermore, if the axis name is programmed in a ISO line, it is necessary to add also the
separator character = in order to avoid confusion with the programming of parameters of the type
X_. The programming of two characters parameters whose second character is _ is forbidden if
at least one axis is defined with a two letter name in the machine setup data. In machines with at
least one two letter axis name, it is not possible to use parameters like X_ or A_, or __. It is
always possible to program parameters like _X or _A.
Thw following examples will clarify further the various situations:
G1 F1000 Y20 Y_2=100 X_1=25,3

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).

3.7 ORIGINS AND LENGTHS


The positions measured by the machine tool transducers refer to the physical zero of the
transducer, a point normally associated to this device and that is not significant for the geometry of
the machine.
Base The reference point of the machine tool is established by the manufacturer as BASE ORIGIN
origin and cannot be modified by the user.
The base origin can be used for special operations involving movements referred to the physical
structure of the machine (for example, tool change).
Additional The user has an SUPPLEMENTARY ORIGIN at his disposal (that is associated to the base
origin origin) and to which the workpiece measures refer.
The programmed (and displayed) positions therefore represent the difference between the
measures taken and that of the active supplementary origin.

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.

VALUE VALUE VALUE


BASE ORIGINS SUPP. ORIGINS PROGRAMM. DIMENSION

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.

3.7.2 Origin conditioned by its existence


This instruction is reserved for writing evolved macros.
With this instruction, an origin can be activated only if it exists (defined in the origins table) and
without giving any alarm if it does not exist, using the 'o' lower case character instead of the 'O'
upper case one. Example:
OX18
Gives an alarm if the OX18 origin does not exist.

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.

3.7.3 Origin offset


The origin OF is automatically added to the programmed supplementary origin.
'OF' origin (e.g. XOF for X axis) can be written/read in the active additional origins section either
directly or through the :W/:R evolved instructions.
This origin cannot be directly programmed (alarm CN1D14), but is automatically added to the
programmed supplementary origin.
If this origin is undefined in the table for supplementary origins, it is interpreted as 0.
For example, the origin table contains:
:OS
X1=20
if we program:
!:WOXOF<54>!
the origin file will now contain:
:OS
X1=20
XOF=54
after programming:
OX1
the value of the offset origin XOF will be automatically added to the value of origin X1,
therefore the displayed position of the X axis will be modified by 74 displayed units and not by 20.

3.7.4 Single Origin


The Single Origin allows activating on all machine axes the origin specified with an "Onumber"
command, for example:
O1
This avoids having to repeat the origin programming on all individual axes, in the example OX1
OY1 OZ1, etc...
The "single origin Onumber" is valid from part-program, MDI and 4 JOG activity.
Characteristics:
- The number consists of up to 3 digits, from 1 to 999. The number zero (reserved for the base
origin) is not allowed; to return to the base origins, OX0, OY0, etc. must be programmed.
- After O there must be a number in the explicit form. Origins with a letter or numbers
programmed using an expression are not permitted.
- Activated origins are always global ones (file 126 for the zero process) and the single origin
request also includes programming G37OG, which switches from any local origins to global ones.
- The activation of any origin (and thus of the single origin as well) during activity 4 is
incompatible with automatic execution: any automatic execution interrupted by an activity 4 cannot
be resumed after enabling any origin, including the single one.

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.

3.7.5 Tool length


The tool length is the value of parameter L.
The programming of L in an ISO line is immediately taken as the new length of the tool.
N10L10.23 Tool length 10.23
The programming of an evolved line
N10!L=10.23!
Is not immediately taken as a new length but will only modify the L parameter: it can
automatically be acquired later as a length if functions needed to recalculate corrections have also
been programmed (see paragraph Origin and length management)
The axis involved in the tool length is defined by G43 (positive correction) or by G44 (negative
correction).
Tool length L can be either positive or negative.
Length correction can be:
cancelled by programming L0 in an ISO line
suspended using G45 (restored by G43/G44)
suspended together with the origins using G53 (restored by G54

Tool length in lathes systems


In lathes machines the tool length is expressed in the two directions X and Z through the
parameters LX and LZ.
The description and the programming rules above described for the L parameter (tool length for
milling machines) may be also applied to the LX and LZ lengths.
For example:
N10 LX10.3 LZ-11.34 tool length 10.3 along X and -11.34 along Z

3.7.6 Origin and length management


Here is information for expert programmers how to manage origins and length corrections within
Z32.
The Z32 memory stores the map of the active origins, consisting of the following for each axis:
origin identifying character
source program or subprogram
Z32 recalculates corrections in particular cases, as follows:
at reset (all the origins are zero)
after a variation of the status of G43, G44, G45, G53, G54 (even if this variation
occursas an effect of a G103 restoring the previous status)
after programming L in an ISO line
after LX or LZ programming (lathes) in a ISO line
after DDL programming in a ISO line
after DLX or DLZ programming (lathes) in a ISO line
after programming one or more origins
During correction recalculation, the following items are involved:

142
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters

the tool length


the supplementary origin of each axis
Programming L in an evolved line: !L=! DOES NOT prompt correction recalculations: the L
parameter is modified but it is not acquired as a corrector. Only if an origin is programmed later, will
the L parameter modified in an evolved line be taken as a new corrector.
If the active section of the origins is changed and then the origin of only one axis is programmed,
all the origins will be recalculated. However, only the programmed origin will change as the other
ones are looked for in the previous active sections (see also G102, G103 and G37). It is therefore
possible that origins coming from different sections will be active at given moment for various axes
(however this situation should be avoided as it may cause confusion).

3.7.7 DDL and DDR: tool length and radius modification


The parameters related to the tool length (L parameter) and tool radius (R parameter) are
normally acquired by Z32 starting from the tool description contained in the tool table.
Data contained in the tool table may be modified from the part-program, by programming L or R.
In case of tool parameters modifications due for example to a sharpening, it may be necessary
to change the L or R geometrical parameters by small quantities (maximum some hundredths of
mm).
In order to avoid rough errors, it is better if the operator (especially a not skilled operator) doesnt
input the whole new value, but only its difference: in this mode an error is made more evident,
because the difference must be contained in fractions of a millimeter.
For this purpose, the two system parameters DDL and DDR set the difference, respectively, for
length L and radius R.
Warning: the usage of these parameters may contrast with the PLC, if the PLC is managing a
tool radius change (ZZRAYNEW variable). Consult and agree with the machine tool builder.
The actual value for L and R used by Z32 is the value of L+DDL and R+DDR.
In position display, L is recomputed if L or DDL 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 DDL in a SIO line to immediately obtain its full functionality.
Also DDR should be programmed in an ISO line, in order to immediately obtain its full
functionality, thus limiting possible incompatibilities with the PLC.

3.7.8 DLX and DLZ for tool length modification (lathes)


The parameters related to the tool length for lathes, LX and LZ parameters, are normally
acquired by Z32 starting from the tool description contained in the tool table.
Data contained in the tool table may be modified from the part-program, by programming LX or
LZ.
In case of tool parameters modifications due for example to a sharpening, it may be necessary
to change the LX or LZ geometrical parameters by small quantities (maximum some hundredths of
mm).
In order to avoid rough errors, it is better if the operator (especially a not skilled operator) doesnt
input the whole new value, but only its difference: in this mode an error is made more evident,
because the difference must be contained in fractions of a millimeter.
The two parameters DLX and DLZ have been introduced for this purpose, setting the difference
with respect to the LX and LZ length, respectively.
The actual value for LX and LZ used by Z32 is the value of LX+DLX and LZ+DLZ.

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

3.8.1 Axis names


The axes names may have an address specified by one character or more characters in case of
two letters axis names (with numerical index). The axis identifier (first character) may be a letter
chosen among the following:
A B C D H P Q U V W X Y Z
The numeric index for two letter axes must be a digit in the range 1-9.
For further details on the programming syntax for axes names parameters related to two letter
axes, see paragraph Axes with two letter names (with numerical index).
And must be defined in the machine settings.

3.8.2 System parameters


They have a very precise meaning in Z32 programming and include the following:
AE communication from the PLC
AM measure of the first axis
AN probe correction, first axis, negative
AP probe correction, first axis, positive
AU communication to the PLC
BM measure of the second axis
BN probe correction, second axis, negative
BP probe correction, second axis, positive
CM measure of the third axis
DA first axis translation
DB second axis translation
DC third axis translation
DDL tool length L difference
DDR tool radius R difference
DLX tool length compensation (lathes)
DLZ tool length compensation (lathes)
DM measurement distance
F feed
HR polar co-ordinate radius and G110
HT polar co-ordinate angle and G110
HX X Cartesian co-ordinate and special G parameter
HY Y Cartesian co-ordinate and special G parameter
I dimension of first axis centre
IR dimension of first axis rotation centre
IS dimension mirroring centre for first axis
J dimension second axis centre
JR dimension of second axis rotation centre
JS dimension of mirroring centre for second axis
K threading pitch and G110
KA selection parameter
KD additive factor for single axis
KG permanent subprograms
KM multiplicative factor single axis
KP scale factor in the plan
KT third axis scale factor
L tool length (milling machine)

D. ELECTRON 145
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual

LEF tool length effective value (L+DDL)


LX tool length (lathe)
LZ tool length (lathe)
M auxiliary function
MA auxiliary function
MB auxiliary function
MC auxiliary function
MS maximum Speed in G96
P NURBS order
QA auxiliary slope
QF final slope
QR rotation angle
QS slope of mirroring axis
R tool radius
RA circle radius
RB bevel
REF tool radius effective value (R+DDR)
RR linkage radius
S speed
T programmed tool
TA active tool place
TAG tool gouge minimum angle (G410/G420 - lathe)
TAO Tool Adaptive Override (TAO feature)
TRC Tool Reference Current (TAO feature)
TB programmed tool place
TT dwell time
# synchronizer between part-program and ML logic
#A synchronizer between part-program and ML logic
#B synchronizer between part-program and ML logic
#C synchronizer between part-program and ML logic
#D synchronizer between part-program and ML logic
#E synchronizer between part-program and ML logic
#F synchronizer between part-program and ML logic
#G synchronizer between part-program and ML logic
#H synchronizer between part-program and ML logic
#I synchronizer between part-program and ML logic
#J synchronizer between part-program and ML logic
#K synchronizer between part-program and ML logic
#L synchronizer between part-program and ML logic
#M synchronizer between part-program and ML logic
#N synchronizer between part-program and ML logic
#O synchronizer between part-program and ML logic
#P synchronizer between part-program and ML logic
#Q synchronizer between part-program and ML logic

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

3.8.3 User 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).

3.8.4 Parameters array PAR[512]


Z32 makes available an array of index parameters PAR[...] to increase the number of parameter
Parameters and make parameter addressing more flexible.
with address
PAR[0], PAR[1], PAR[2], up to PAR[512] are part-program parameters and can be used like
parameters with alphabetic address. The PAR[] array has the same floating-point numerical format
as parameters with alphabetic address.
The parameters with alphabetic address and the PAR[ ] parameters can be used together in the
part-program. The PAR[ ] array is zeroed at reset.

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.

3.8.5 Logic array of parameters PAL[512]


Also another array of parameters, PAL[...] is available that is dedicated to communication with
the programmable logic.
The addressing and the using procedure in the part-program expressions are the similar to array
PAR[ ]. The differences are:
The numerical format is integer and not floating point.
This makes reading and writing by the PLC quicker (PLC must be as fast as possible).
The parameter can be used in a normal manner in the part-program: the integer conversion is
done automatically without special functions.
The elements with index greater than 255 are protected.
The array elements from 256 to 512 are for special communication with the programming logic.
- the user part-program can only read them (if the user part-program attempts to write a
programming alarm PROGRAM ERROR is triggered).
- they can be read and written by special sub-program (special M or system canned cycle

3.8.6 Logic array of parameters PLS[512]


It is a logic arrays of parameters with 513 elements, integer and system, similar to the PAL[ ]
parameters array.
These parameters can be accessed in the range PLS[0] PLS[512]; they may be read by the
user part-program or by the special subprograms (special M or system fixed cycle) alike the PAL[ ]
array (index greater than 255).

3.8.7 Retentive parameters array PRM[...]


The retentive parameters array PRM[ ] is not a process array. The PRM[ ] parameters are stored
in the CMOS memory and are loaded with the stored values after system power on. This feature
and the dimension of the array are set by the machine tool builder; please refer to the machine tool
builder specifications for usage information.
Example:
PRM[102]34.589 ; the value 34,589 is loaded in PRM[102]

G0X<PRM[102]> ; the axis X is moved to the position 34,589.

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.

3.8.8 Parameters array POS[12]


The 13 elements parameter array POS[12] (index from 0 to 12) is an array of floating point
parameters; it is a process array and accessible by the part program.
These parameters contain the values of positions programmed for the continuous axes of the
process, excluding the origins and tool length compensations.
WARNING: this array may be only used by D.Electron personnel.

3.8.9 Parameters array ZFP[1023]


It is a part-program parameters array composed by 1024 elements, from ZFP[0] to ZFO[1023].
This array has been introduced for D.Electron exclusive use, in order to avoid conflicts with other
parameters already used by the customer.
WARNING: nothing is made to inhibit the usage of these parameters also in user part-
programs, but it is recommended to leave this array for D.Electron exclusive use in order to
avoid possible conflicts. No warranty can be offered for a possible future inhibition for the
usage of these parameters in user programs.

3.8.10 Parameters array SET[60]


It is a set of parameters which can be accessed via the SET [60] array and concerns RTCP
settings and the continuous axes end of travel.
SET[.] parameters can be used in reading mode by any part-program (even non-system), and in
reading/writing mode by system CMOS subprograms, i.e. with a number greater than 127, and in
temporary subprograms or system subtemp (i.e. with a number between 65 and 72 included).
Programming a SET[.] parameter by a user part-program generates the CN2C14
INCOMPATIBLE PARAMETERS alarm.
The detail of the individual SET[ ] parameters is as follows:
SET[0] = (G117) with the spindle length in the X direction type 0 (in mm) if G117 mono-rotating,
with rotation centres distance in the X direction type 0 (in mm) if G117 bi-rotary

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

SET[36] = negative end of travel, axis with logical number 0, in mm or degrees


SET[37] = positive end of travel, axis with logical number 1, in mm or degrees
SET[38] = negative end of travel, axis with logical number 1, in mm or degrees
...
SET[59] = positive end of travel, axis with logical number 12, in mm or degrees
SET[60] = negative end of travel, axis with logical number 12, in mm or degrees
They are accessible in reading and writing mode and subject to process switch.
Note: The dimensions of linear axes are in millimetres even if the machine is in inches.
The change to the ends of travel remains also at RESET and program start, but is not
permanent at shutdown: at power on, the ends of travel defined at setup are activated.
The new end of travel is immediately written with the SET[35]SET[60] parameters, but its effect
can be delayed even by many blocks because it does not affect the blocks that may be present in
the look-ahead buffer. The installer is required to take care of any synchronisation.

3.8.11 Three letters parameters

Parameters accessible only through system subprograms


On various occasions, the installer needs to use part-program parameters in system
subprograms.
The parameters that can only be accessed through system subprograms are undistinguishable
from parameters accessible through user subprograms, with possible interference.
For this reason, 156 parameters have been reserved for system subprograms.
These parameters have a three-character address (not allowed by the previous releases of the
software, therefore they cannot be mistaken) with these specifications:
- the first character is a backslash \
- the second character is a capital letter from A to F (six possibilities)
- the third character is a capital letter from A to Z (twenty-six possibilities)
In total, 26x6 = 156 combinations are possible.
These parameters can be used the same way as all the other parameters, both in ISO and
evolved lines.
Using these parameters does not increase the number of parameters used by the part-program
(if the number of 60 parameters is exceeded, the CN4B14 TOO MANY PARAMETERS alarm is
released).

3.8.12 Use of parameters


At reset, the axes positions (considered as parameters), system parameters and user
parameters are initialized with zero, except for parameters KP and KT which are forced to 1.
At reset the CNC recognizes the active tool and reads its description in the tool table, which is
analysed, and the relevant parameters are set according to that description.
So, at reset all the parameters are equal to zero, except for:
KP and KT preset to 1
T preset according to the tool on the spindle

152
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters

TA and TB preset according to the tool place on the spindle


Parameters defined in the description of the tool on the spindle are preset in accordance with
the values included in the description itself.
The value of the parameters stored in the Z32 memory is always the last parameter
programmed (in ISO or evolved line).
Current positions remain those previously programmed even if, due to various circumstances
(radius and length compensation, origins, roto-traslations, etc.) values really reached are different
from those programmed.
TA and TB (present and future place of the tool) are exceptions and are directly up-dated by
Z32 after programming a T instruction or a tool change operation.
Inside an ISO line, the operator can give values to any parameters, in order to use them for
future processing. E.g.:
X10 XA12 XB14 XC-20
to parameters X, XA, XB, XC are assigned values 10, 12, 14, -20.
By programming X axis you will have a movement of the X axis to the programmed value; the
programming of XA XB and XC will not produce any movement: parameters will be up-dated, and
they will be added to the list of parameters if they are met for the first time.
If the CNC meets a parameter, which has never been defined before, it will not display an alarm
message, but it will consider the value of that unknown parameter as equal to zero.
During the execution programmer can define a maximum of 60 parameters, but if one of them is
equal to zero, it will be not counted in the 60.
In other words, if a parameter has value = 0, it will be removed from the list of known parameters
and considered as never having been defined. This operation will not produce any errors, because
the CNC gives to undefined parameter the value = 0.
If necessary, therefore, the operator can cancel the parameters from the list of known
parameters, assigning to them value 0. This procedure is recommended above all inside standard
sub-programs (of manufacturer or end user) for parameters used as support for intermediate
results to reduce the number of parameters used.

3.8.13 Programming of parameters through expressions


So far we have seen that a numerical value can be assigned to a parameter by programming the
value after the parameter address. Example: X100.
Z32 also allows to program a parameter value as a result of an algebraic expression. This is
obtained by programming the address followed by the expression enclosed in acute brackets.
E.g.:
X<X>
The expression can even be a complex mathematical formula, containing:
constants: numeric values with sign, 9 figures before or after the decimal comma or point
PI, (Greek PI with 9 figure precision)
other parameters
mathematical operators:
+ addition
- subtraction
* multiplication
/ division
RQ square root
SN sine

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.

3.8.14 Parameters in permanent memory


It can be useful to save in permanent memory one or more parameters in order to be able to
read them in later points or even during subsequent program runs.
This can be done, as we shall see later in the chapter on evolved lines, with instructions :R and :W.
The global tables of process parameters are reserved for memorizing parameters.
The table begins with a description of one or more lines at the beginning.
The line:
:PA
identifies the beginning of the active parameter section.
The following lines, like those ones pertaining to origins (file no. 126, see chapter on Origins and
Lengths), include the values of the various defined parameters.
E.g.:
:PA
X1 = 10
HB = 37,45
CK = 12345,678
Please note that parameters memorized in CMOS always consist of two characters and that the
second one can be a number: parameters used in programming can consist of one or two
characters; the second one cannot be a number.
Apart from the global parameter section (file 125) there can be one or more local sections at the
end of each program or sub-program. With G37PL the operator can activate the local section at
the end of the program, whereas with G37PG he can activate the global section.
At reset, the global section is always active.

3.8.15 Parameters #, #A #Q and ##[33] in real-time


To synchronize the part-program with some particular machine events defined in the PLC, (for
example for a quick and non stopping dialog with the PLC), it is possible to use the parameters:
- #, #A, #B, #C, #D, #E, #F, #G, #H, #I, #J, #K, #L, #M, #N, #O, #P, #Q.

D. ELECTRON 155
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual

- ##[33] (array of 34 elements)


The programming of auxiliary functions (for example M or G112) produces this synchronization,
but a stop is requested by these functions which are prohibited during some operations.
The parameters #, #A #Q and the array ##[33] can be read by ML logic in synchronized time
and can be programmed also in radius compensation only if programmed in ISO line.
If they are used in evolved line, they will behave like any other parameter.
The array ##[33], composed by 34 elements (##[0] ##[33]), increases the quantity of real time
parameters available and extends their characteristics.
The program may compute the array index with an expression of the type:
HA5
##[HA*2-1]40
assigning the value 40 to the parameter ##[9].
The first 18 elements of the ##[33] array are actually alias of the old programming mode:
##[0]20 is equivalent to #20
##[17]20 is equivalent to #Q20
##[18] ##[33] have no correspondence in the old programming mode.
Please refer to manual M99 - Programmable Logic for examples and clarification
(ZZVALCANC[1], ZZVALSUP[31], ZZVALSYNC[33]).

3.9 THREE LETTERS FUNCTIONS ABS, TAN, NEI, INT, RST

3.9.1 Absolute value function ABS(expression)


Computes the absolute value of an expression.
Example:
HA-4 HX<ABS(HA)+10>
HX assumes the value 14.

3.9.2 Tangent function TAN(expression)


Computes the trigonometric tangent of an expression, whose result is an angle expressed in
degrees.
Example:
HX20 HA<20+TAN(HX+10)>
HA assumes the value 20+tan(30) = 20.57735

3.9.3 Truncated integer INT(expression) and rounded integer NEI(expression)


functions
Compute the integer part of an expression, with two different approximations: INT acts a
truncation, while NEI (NEarest Integer) rounds to the nearest integer. Examples:
INT(1.2) produces 1, also NEI(1,2) produces 1

156
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters

INT(1.9999) produces 1, while NEI(1.9999) produces 2


If the expression value is exactly in the middle of two integers, NEI operates a rounding to the
higher integer, therefore:
INT(1.49999999) produces 1, while NEI(1.5) produces 2
If the value of the expression to be rounded is negative, the rounding and truncation operations
are executed on the absolute value, while the sign is only considered on the result. Example:
INT(-1.2) produces -1, also NEI(-1.2) produces -1
INT(-1.9999) produces -1, while NEI(-1.9999) produces -2
INT(-1.49999999) produces -1, while NEI(-1.5) produces -2
Examples:
HA.1 HX<10+INT(HA)>
The HX value is 10, because INT(0.1) is zero.
HA.1 HX<INT(HA*100)>
This example is provocative and is useful to carefully consider the decimals usage. On a first
examination, the result seems to be HX=10, but this is not true: the result will be 9, but it is not a
sure result because it depends on roundings made on the least significant digit of internal
formats representing the numbers.
In fact the internal Z32 number representation is binary, and in binary format the value 0.1
cannot be exactly represented. It is the same situation arising in our normal decimal system with
periodic numbers: 20/3 is equivalent to 6.66666 but cannot be represented with a finite number of
digits.
Therefore, in a binary system, the result of 100*0.1, where 0.1 is approximated with a finite
number of digits, produces a result not exactly 10, but a little bit less, like in a decimal system where
3*6.66666 doesnt produce 20, but 19.99998.
Therefore, the truncation operated by INT doesnt produce the expected integer, but one less (9
instead of 10 in the bynary example and 19 instead of 20 in the decimal system).
The programmer must pay attention because the result depends on very marginal conditions,
not easy to forecast. For example, in a decimal system, if 20/3 were approximated with 6.66667, the
multiplication by 3 would produce 20.00001, and the INT result were 20.
In this case , the NEI function produces a completely certain result:
HA.1 HX<NEI(HA*100)>
The result is certainly 10, because the internal computations are made with very high precision
and the error is very much lower than 0.5, representing the tolerance range.
But pay attention: also the NEI function may produce uncertain results if the value is around 0.5.
Example:
HA.1 HX<NEI(HA*5)>
The result may be 0 or 1, depending on computing approximations.
It is important to note that if a programs operates correctly, but in marginal conditions, it may be
subject to errors using only slightly different parameters, or (very important) with future versions of
Z32 software, possibly operating different approximations.
It is recommended to be very careful in considering computing approximations and to avoid
marginal tolerance conditions, possibly bringing to uncertain results, depending on small
parameter or operating conditions changing.

D. ELECTRON 157
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual

3.9.4 Status read function RST(expression)


Executes a reading of the machine status, depending on the requested status
Normally the expression will be a numeric value directly expressed; in rare cases it will be useful
to use an expression to indicate the state to be read.
RST(2) will be programmed, for example, to read the state 2.
The RST function is normally reserved to system programmers to handle macros or
subprograms of general usage for machines with different software update status or with different
functionalities. The function should not be used by a normal programmer.
Requested states and related answers are:

RST(0) reads the "SIS" version of Z32


The value returned is (version*10)+subversion.
For example, if the version is T109-3, the value of RST(0) is 1093.
It may be useful to condition the execution of special functions available only starting from a
given version.
Example:
--IF RST(0) >= 1094
(instruction 1)
--ELSE
(instruction 2)
--END IF
instruction1 is executed if the software version is at least T109-4, otherwise instruction2 is
executed.

RST(1) reads the millimeters/inches machine status


The value returned is 0 if the machine is in millimeters, 1 if the machine is in inches.
Example:
--IF RST(1) = 0
HA100
--ELSE
HA<100/25.4>
--END IF
Adjusts the HA value in inches or mm.
RST(1) takes also in account the active G70-G71 forcing.

RST(2) reads the programmed spindle status M3/M4/M5


The value returned is +1 if the spindle is rotating in M3, -1 if the spindle is rotating in M4, 0 if the
spindle is not rotating (M5, M19, M6 ).
Example:
--IF RST(2) = 1
M4
--ELSEIF RST(2) = -1

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.

RST(3) reads the Z32 language


The value depends on the language define in setup:
0 = Italian
1 = English
2 = French
3 = German
4 = Portuguese
5 = Croatian
Example:
--IF RST(3) = 0
ERRORE, VALORE DI HA TROPPO GRANDE
--ELSEIF RST(3) = 2
ERREUR, VALEUR DE HA TROP GRAND
--ELSE
ERROR, VALUE OF HA TOO HIGH
--END IF
Displays an error message in three languages, Italian or French, if defined in setup, otherwise in
English if any other language was defined.

RST(4) spindle angular position


This function is reserved to system canned cycles programmers.
It returns the part-program the angular position of the spindle in degrees, referred to the zero
encoder and then inclusive of the spindle base origin.
Specially useful for boring cycles, where the boring bar extraction must be preceded by a
misalignment in the cutting edge direction.
This function may be executed by forcing a spindle orientation at end of cycle, or by stopping the
spindle in any point and misaligning the tool in the direction where the spindle were stopped.
A correct usage of this function presumes the spindle has completed its deceleration ramp and
at standstill when the reading is made; this condition is not always assured by the PLC auxiliary
functions. In cases where this certainty cannot be assured, the programmer must insert a waiting
cycle, and verifying the spindle is at standstill, for example:
--DO
HA<RST(4)>
G4TT.05
--LOOP IF ABS(HA-RST(4))>0.1
G4TT.5
HA<RST(4)>

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.

RST(5) spindle angular position in G61


The part-program variable RST(5) contains the angular position of the spindle when a G61
measure is made.
Cleared at RESET, at program beginning and when G61 is programmed.
After a correct execution of G61, it contains the angular position of the spindle, referred to the
base origin, freezed at the moment where the G61 measure has been made.
If the G61 measure is not correctly executed, the variable remains to zero.
Not significant if no spindle exist.
Useful to create special system cycles or macros, for example to intercept the cutting edge of a
tool through a laser beam.

RST(6) value of the spindle ramp


The function RST(6) returns the value of the spindle ramp defined in machine setup.
The main use of this data is to compute the G63 braking space (rigid tapping) in order to create
generic tapping macros, independent from the machine setup data.
The return value is expressed in RPM/second.
For example: if the spindle ramp is 3000 RPM in 2 seconds, RST(6) contains the value 1500.

RST(7) reads the radial/diameter programmed status


The value returned by the function is dependent from the active radial/diameter programming
status:
0 = if radial programming is active
1 = if diameter programming is active

RST(8) programmed KA value with G150


The function RST(8) returns the programmed KA value with G150.

RST(9) programmed I value with G150


The function RST(9) returns the programmed I value with G150.

RST(10) coolant control


The function RST(10) returns one of the following values:
- 0 if neither M7 and M8 are active
- 1 if only M7 is active
- 2 if only M8 is active
- 3 if both M7 and M8 are active

RST(11) reads the millimeters/inches setup status


The function RST(1) gives the actual machine programming status (1 = inches; 0 = mm)
including the G70/G71 forcing.

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.

RST(12) mirroring status


The RST(12) function returns the mirroring status:
- 0 if mirroring is not active
- 1 if mirroring active

RST(13) G109 radius correction mode


The RST(13) function returns the radius correction status:
- 0 if G109A is active
- 1 if G109B is active
- 2 if G109C is active
- 3 if G109D is active
- 4 if G109E is active

RST(14) soft approach time for G63/G33


The RST(14) function returns the G63/G33 soft approach time contained in the machine setup.
The returned value is expressed in milliseconds.

RST(15) RST(27) setup maximum acceleration for continuous axes


The functions from RST(15) to RST(27) return the setup maximum acceleration for each of the
13 possible continuous axes of the process where the part-program containing this function runs.
RST(15) returns the acceleration of the first axis (normally X), RST(16) the acceleration of the
second axis (normally Y in milling machines), etc. up to RST(27) returning the acceleration of the
thirteenth axis.
2 2
The returned values are expressed in displayed units/sec (mm/sec for linear axes and
2
degrees/sec for rotating axes).
2
ATTENTION: the unit of measurement of linear axes is in mm/sec even for machines in inches.

RST(28) RST(40) setup rapid speed for continuous axes


The functions from RST(28) to RST(40) return the setup rapid speed for each of the 13 possible
continuous axes of the process where the part-program containing this function runs.
RST(28) returns the rapid of the first axis (normally X), RST(29) the rapid of the second axis
(normally Y in milling machines), etc. up to RST(40) returning the rapid of the thirteenth axis.
The returned values are expressed in displayed units/min (mm/min for linear axes and
degrees/min for rotating axes).
ATTENTION: the unit of measurement of linear axes is in mm/min even for machines in inches.

RST(41) part-program millimeter/inches status


The function RST(14) returns the value 1 if the part-program is executed in mm, and 1/25.4 if it
is execute in inches.
RST(14) considers the millimeter/inches (or vice versa) forcing possibly programmed with
G79/G71.

D. ELECTRON 161
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual

For example, if the following is programmed:


X<100 *RST(41)>
the X axis is positioned to the fixed position of 100 mm, regardless of the mm/inches
programming mode active.

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.

RST(45) RST(47) XYZ axes position corrections due to G118


The RST(45), RST(46) and RST(47) functions return the mm value of the corrections for XYZ
axes due to G118.

RST(48) RST(50) AM BM CM measure values of G61/G61KA1 in the system roto-translated by


G116
The RST(48), RST(49) and RST(50) functions return the AM, BM, and CM measure values
provided by G61/G61KA1 in the system not roto-translated by any active G116 during measuring.
In particular:
if G61 or measure error
- RST(48) = AM
- RST(49) = BM
- RST(50) = CM
if G61KA1 and measure successfully completed
- RST(48) = AM reported in the reference system not roto-translated by any G116
- RST(49) = BM reported in the reference system not roto-translated by any G116
- RST(50) = CM reported in the reference system not roto-translated by any G116

RST (51) L tool length correction status


The RST(51) function returns the L tool length correction status:
1 if L tool is added (G43)
-1 if L tool is subtracted (G44)
0 if the tool length correction is active or has been suspended (G45/G53)

RST(52) L tool status with respect to the spindle length in G117


The RST(52) function returns the L tool correction status with respect to the spindle length in
G117. In particular:
0 if for G117 the tool L has the same sign as the spindle length
1 if for G117 the tool L has the opposite sign of the spindle length

RST (53) degrees/turn of G117 rotational dragging axis


The RST(53) function returns the degrees/turn of the G117 rotational dragging axis (usually
360).

RST(54) degrees/turn of G117 rotational dragged axis


The RST(54) function returns the degrees/turn of the G117 rotational dragged axis (usually 360).

RST(55) degrees/turn of G118 rotational dragging axis

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).

RST(56) degrees/turn of G118 rotational dragged axis


The RST(56) function returns the degrees/turn of the G118 rotational dragged axis (usually 360).

RST(57) RTD(72) value of the axes base origins


The functions from RST(57) to RST(72) return the axes base origins values in logical number
order.
The unit of measurement of the returned value is millimetres or inches in line with the machine
setup.

RST(73) status G142 (retract)


The RST(73) function returns the G142 status:
1 = if G142 has been programmed after the last reset or program start
0 = in all other cases

RST(74) spindle position with respect to the base origin


The RST(74) function returns the spindle dimension referred to the base origin.

RST(75) RST(83) coefficients of the G116 rotation matrix (aij)


The functions from RST(75) to RST(83) contain the coefficients of the G116 rotation matrix (aij)
In detail (aij = coefficient that is on the matrix i line and j column):
| RST(75) = a11 RST(76) = a12 RST(77) = a13 |
| |
| RST(78) = a21 RST(79) = a22 RST(80) = a23 |
| |
| RST(81) = a31 RST(82) = a32 RST(83) = a33 |

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

X' = a11*X + a12*Y + a13*Z = 0*X + 0*Y + (-1)*Z = -Z


Y' = a21*X + a22*Y + a23*Z = (-1)*X + 0*Y + 0*Z = -X
Z' = a31*X + a32*Y + a33*Z = 0*X + 1*Y +0*Z = Y
where X', Y' and Z' are the coordinate axes of the rotated system. X, Y and Z are those of the
straight or unrotated system

RST(84) status G116 (roto-translation)


The RST(84) function returns the G116 status:
1 = active
0 = not active

RST(85) RST(88) dragged/dragging axes end of travel of G117 (RTCP head)


The functions from RST(75) to RST(83) contain the dragged/dragging rotational axes ends of
travel of G117 (RTCP head), in particular:
RST(85) = returns the value of the RTCP head (G117) dragged axis positive end of travel in mm
RST(86) = returns the value of the RTCP head (G117) dragged axis negative end of travel in mm
RST(87) = returns the value of the RTCP head (G117) dragging axis positive end of travel in mm
RST(88) = returns the value of the RTCP head (G117) dragging axis negative end of travel in mm
Particular cases:
- If RTCP head not defined in setup, the 0 value always returns
- If dragging axis end of travel is requested but RTCP head is mono-rotating, the 0 value is
always returned
- If an end of travel is required but the axis is without that end of travel, 2147483647 returns if
end of travel is positive, and -2147483648 if end of travel is negative.

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.

RST(92) RST(151) with G881G899 and G901G999 parameters programming status


The functions from RST(92) to RST(151) return the programming status of G881G899 and
G901G999 parameters. The details are as follows:
parameters of G881G899
RST(92) = MHA-NA programming status (1 = programmed, 0 = not programmed)
RST(93) = MHB-NB programming status (1 = programmed, 0 = not programmed)
................................................
RST(117) = MHZ-NZ programming status (1 = programmed, 0 = not programmed)
RST(118) = E programming status (1 = programmed, 0 = not programmed)
RST(119) = I programming status (1 = programmed, 0 = not programmed)
RST(120) = J programming status (1 = programmed, 0 = not programmed)
RST(121) = K programming status (1 = programmed, 0 = not programmed)
parameters of G901G999

164
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters

RST(122) = MMA-NA programming status (1 = programmed, 0 = not programmed)


RST(123) = MMB-NB programming status (1 = programmed, 0 = not programmed)
................................................
RST(147) = MMZ-NZ programming status (1 = programmed, 0 = not programmed)
RST(148) = E programming status (1 = programmed, 0 = not programmed)
RST(149) = I programming status (1 = programmed, 0 = not programmed)
RST(150) = J programming status (1 = programmed, 0 = not programmed)
RST(151) = K programming status (1 = programmed, 0 = not programmed)

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)

Cascaded usage of functions


Also these three letters functions may be cascaded, like all other functions managed by Z32, for
example:
HA-10 HX<NEI(1000*TAN(ABS(HA)))>
HX assumes the value +176 (the tangent of +10 is 0.176327, thus NEI is applied to 176.327).
Note that this is a certain result because the uncertainty NEI point would be 176.5, with a
consequent very large tolerance range.

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

4. TOOLS - EXECUTION OF ISO LINE

4.1 TOOL MANAGEMENT ('T', 'TA', 'TB')


Tools for every process available are listed in a TOOL TABLE, which can be global or local
(at the end of the part-program).
The assignment of global table/process is the following:

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

NOTE for lathes systems


The following discussion considers the tool table of a milling machine (tool length described by
the parameter L). In case of a lathe, the discussion is still valid, but the two parameters LX and LZ
(tool length along X and along Z) must be considered, instead of the L parameter used in the
discussion.
We suggest care in using local sections, which must be used only when necessary and in
agreement with the manufacturer.
On reset, the global section is active. G37TL instruction activates local sections while G37TG
resets the global section.
The active sections of the tool tables start with the line: :TL
:TL Starting from the line following the :TL line, the operator can edit the tool lines containing T,
the tool number and its description with a total number of 247 characters; lines with a higher
number of characters will provoke the release of the CN1D14 alarm when the tool is in the chuck.
The tool table uses the memory space necessary for tools actually described: tools not entered,
do not occupy any memory space.
Example of tool description line:
T231#34L100R20
tool no. 231, place 34, length 100, radius 20.
Every description line must begin with the letter T, followed by the tool number (up to 9 integral
decimal digits the initial zeroes must be omitted) and by the sign #
In our caseT231#.
IT IS IMPORTANT that there be no spaces between T and # and that the initial zeroes be
omitted, otherwise the CNC will not recognise the programmed tool.
The zero tool is edited as T0#... (only one zero).
# The number following # identifies the position of the tool in the tool magazine, which will be sent
Place to the PLC for the search procedure. In our case 34. The initial zeroes of the position may be
omitted.
After that, the programmer can enter some instructions in the same way as an ISO line is
programmed (tool description). In this case L100R20..

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.

4.1.1 Random management


Z32 allows simple and effective random management of the tool. To perform this operation, the
programmer uses the reading and writing instructions to the permanent memory in the special sub-
program connected with M6 instruction.
The manufacturer of the machine tool writes this sub-program for the best adaptation to his
machine.
We give hereunder a sub-program example, detailing operations related to random
management.
In the example, during M6 function, the tool on the spindle is exchanged with that in the tool
magazine.
As a rule, T0 tool identifies an empty place, while place no. 0 identifies the spindle (e.g. T0#0
identifies an empty spindle).
In the following example we have omitted the specific instructions which depend on the
electromechanical structure of the tool changer operation.

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

N10 !IFTA<>0;ERROR! TA testing


//N11 !GON1000! on block search procedure, skipping to the end.
...
N100 MC9999 informing PLC that tool change operation has begun.
... exchanging tools
N200 !:WS#=TB!:WT#=TA! up-dating tools table
N201 T<T> confirming T for display
N202 M6 confirming M6
N203 MC9998 informing logic that change operation has finished.
N1000 G26 end of sub-program
NOTE:
N10 TA must always be equal to zero as it is the place of the tool on the spindle.
N11 During block search procedure the change operation must not be performed in order to
avoid false signal of change operation terminated (N203) and an incorrect writings in the
tool place (N200). As the whole sub-program increments the progressive number by 1,
either in execution mode or in step search procedure, it will not produce any error.
N100 PLC has to memorize MC9999 within a bit of the retentive area to communicate the
change operation running and not yet finished. That bit will be reset in N203. If change
operation is interrupted, the operator shall directly restore the correspondence between
what is written in the tool table and the physical situation of the unit. MC9999 is an example
only: other M such as G100, PAL[](index>255), etc, can be used.
N200 This instruction writes the new tool places. As M6 has not been confirmed yet (N202),
the CNC (which does not have eyes!) still considers the old tool to be the tool on the
spindle, and the programmed tool the new one. This instruction will:
- put the place of the new tool (now on the spindle) in the place of the old one (
returned to tool magazine).
- put zero (N10 TA=0) in the place of the new tool (now on the spindle).
N201 Description of T (taken when T was programmed in the main program) displayed on
the screen still has the old tool place, i.e. it does not include place zero (present from
N200). This instruction displays the correct description on the screen.
N202 This instruction confirms M6 in order to allow the CNC to read the new situation; it up-
dates the first line of the tool table (T...P...).
N203 This instruction communicates the end of change operation; it must not be performed
during block search procedure (otherwise any information concerning a change interruption
may be lost) and it must follow M6 (otherwise any interruption, in the middle of the
operation, will leave the machine with the exchanged tools, but the tools table will not be
up-dated).

4.1.2 Multipurpose tools and random management


Using the random change option described above, the operator cannot define the same physical
tool with two different Ts, in order to change its correctors: in this case only the place of the
programmed tool would be up-dated and not those ones of the other physically identical tools.
The simplest way to solve this problem as follows: the end user has to arrange the tool
description and the program so that the multipurpose can be managed
E.g., the multiple tool T100 can be defined through two correctors:
1) L100 R30
2) L150 R20

170
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line

The tool will be described as follows:


T100#...L100 R30 LX150 RX20
When a tool with correctors 100/30 is selected, no supplementary operation is to be done, as the
CNC will have already read L100 R30 in the tool description.
If, instead, the 150/20 correctors are wanted, it must be written:
...
T100M6
L<LX>R<RX>
...
With the above very simple management the instructions :R or :W that read and write the R
and L parameters may access only to a couple of correctors.
If this limitation has to be eliminated we may write:
TOOL TABLE
...
T100#...L0 R0 LX100 RX30 LY150 RY20
...
PROGRAM
..
T100 M6
L<LX> R<RX>
... here LX and RX are operating
!:WSLX=L,RX=R! at the end, LX and RX are restored
T200 M6
...
T100 M6
L<LY> R<RY>
!:WSL=L,R=R!
... here LY and RY are operating
!:WSLY=L,RY=R!
...
In different words, after tool change the desired pair is written in the tool description. Before
returning the tool to the tool magazine, the pair of correctors will be up-dated according to what is
written in L and R: the result of any macro-instructions modifying L or R will be saved in
PERMANENT MEMORY.

4.1.3 Tool life management


The instructions that Z32 can perform allow the manufacturer of the machine tool to carry out
tool life management in its special tool change sub-program.
We give an example to show how life management can be arranged: the manufacturer of the
machine tool may make a different management, more suitable to his purposes. Please refer to the
information provided by the manufacturer.
The tool description contains US parameter, which identifies the wear of the tool. The value is
equal to 1000 for a new tool and decreases to zero with use.
US parameter is up-dated in the tool description every time the tool is changed:

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)

4.1.4 Management of tool families


This function is above all designed for machine tool manufacturers, who can use it in their
specific tool change subprograms.
It allows the management of tool families made up of several tools having the same "T" code.
For example, the tool table could include three tools belonging to the T4 family:
T4#8L10,3R4
T4#9L12R4,002

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

The search result is returned in the J parameter.


The search is performed in the active section of tools (i.e. the same section in which the
programmed T would have been searched).
If the family includes no tool, the search result will be J=0.
Storing of the family number of the active tool
The active tool is described in the heading of the global tool file (file 127 if process zero) together
with the origin program. For example:
T4P127
means that the T4 tool in the global table of file 127 is active.
If the tool is not the first in the family, this fact is also reported in the global file heading:
T4P127J3
means that the 3rd tool of the T4 family in the global file 127 is active.
If the tool is the first of the family, the J parameter will not appear, even though the family has
other members. Therefore:
T4P127
means that the first or the only tool of the T4 family in file 127 is active.
Access to the family member from the part-program with :R and :W
The fields of the evolved line :R and :W grant access to the parameters contained in the tool
description.
The programmed tool or the active tool can be accessed correctly even though they are not the
first family member.
Modification of tool parameters from task 4
The modification of the tool parameters, for example:
4 ENTERS L:0
is carried out easily without the need for special procedures: the tool is active, and can be
searched for even if it is not the first family member.
Access to the member from DTO, task 4 and 5
It is possible to enter the tool origin file and its position in the family, for example:
4 ENTERS DT42P127J2L+.1
J is followed by the position in the family.

174
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line

4.2 ISO LINE EXECUTION SEQUENCE


An ISO line can include lots of different elementary operations.
Elementary operations are performed following a well-defined sequence, depending on:
- the kind of operations programmed
- the order in which they were programmed
During the execution of a program, and for each ISO line to be executed, Z32 will:
- read the line
- analyze the line
- execute the line
in that order.
During the reading phase the CNC reads the line and displays it on the screen without further
processing.
During the analysis of programmed values, the CNC gives parameters the programmed values,
presets G functions, decodes and memorizes M functions.
These operations will be performed in the order they are meet: if the operator programs two
contrasting values (G0 G1, for example), the last one programmed will remain active.
During this phase the operator does not enter executive commands: the unit is only preset to
receive those commands.
Execution: the CNC examines the values and functions programmed in the line again, and it
sends to the machine the executive commands.
The execution sequence does not depend on the programming order, but on the kinds of
operations programmed.
The execution sequence of the programmed operations is:
- execution G36, G80, G84, G100, G101
- feed (F) display
- G28: axes under control
- speed (S) up-dating and display
- spindle rotation (M3-M4)
- jump to special M sub-program (the CNC does not executes other operations
programmed in the line: the program starts again from the beginning of the following
line).
- T, other M, MA, MB, MC functions
- origins, lengths and displayed positions
- axes movements (G61 and G62 included)
- dwell (G4)
- axes out of control (G29 - idle axes)
- spindle indexing (M19)
- spindle stop (M5)
- tool change (M6 - if M6 instruction is a special one, the CNC will not perform any other
operations programmed in the line: the program starts again from the beginning of the
following line).
- final M (M0, M1, M2)
- jump to KG sub-program
- return from sub-program (G26).

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

5. EVOLVED LINES - JUMPS - CONDITIONING - READ/WRITE

5.1 EVOLVED LINES


It has been seen that with ISO lines all the machine functions can be obtained.
N...!... ...!
With evolved lines, which do not directly produce any machine function, we get a more flexible
control of the program running and the opportunity to skip instructions, etc.
Evolved lines can have a step number (N...) like ISO lines.
Evolved lines are identified by an exclamation point !, that immediately follows the block number.
A line can be a whole evolved line or a whole ISO line. The same line CANNOT CONSIST of
ISO parts and evolved parts.
;! separators Evolved lines are divided into fields, each of which performs an elementary operation. Fields
are separated from each other by ! or ; marks. The function of the ! and that one of ; will be
described in the paragraph concerning IF function. (Please refer to the paragraph Conditioning.)

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.

5.1.1 Parameter definition by expression computation


We have seen that during ISO programming it is possible to assign the value, resulting from an
expression, to a parameter.
This operation is also possible in an evolved line field. In this case, the = sign must be inserted
= sign
and then the expression.
The expression can even be a simple numeric value. E.g.:
N14 !X = 100! to assign to X parameter the numeric value 100
N14 !X = 100-2*R! to assign to X parameter the value 100 minus the tool diameter.
Please note that the X axis does not move to 100 value (or to 100-2*R), as occurs in an ISO
line: the effect of the field is only to give to the X parameter the value equal to 100 (or 100-2*R).

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.1.2 Cartesian/polar co-ordinate conversion and vice-versa


!HX=..; The field !CP! allows conversion of the HX and HY parameters, which represent two Cartesian
HY=..; co-ordinates, into HR (radius) and HT (trigonometric angle in degrees) parameters with polar co-
CP! ordinates.
After this field HR and HT include the result, HX and HY remain the same.
e.g.: with
N10!HX = 1;HY = 1;CP! you get: HR = 1,4142... HT = 45
With field !PC! inverse conversion is obtained.
e.g.: with
N10!HR = 10;HT = 30;PC! you get: HX = 8,6602... HY = 5
HX, HY, HR and HT do not need to be programmed in the line containing CP or PC: they can
also be programmed or identified through a computation, in previous ISO or evolute lines.

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).

5.2.1 Jump to a line without return


This instruction orders Z32 to jump to another line.
E.g.:
N14 !GON64! the CNC jumps to line N64
The line number to be searched for must be at the beginning of the line and it must be written
with the same character sequence used for the search. E.g.:
%N0 X0 to be searched as !GO%N0!
N 47G1 to be searched with the intermediate space:!GON 47!
/N38M6 to be searched as !GO/N38!
The jump to the stated line will be performed as soon as the CNC executes the field containing
that jump.
E.g.:
N14!X=100;Y=-11,5!GON36!
will be performed as follows:
a) assigns to X parameter the value 100;

178
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write

b) assigns to Y parameter the value -11,5;


c) jumps to N36 line
N14!GON36!X = 100!Y = -11,5
will be performed as follows:
a) jumps to N36 line;
b) X and Y parameters do not vary
This performance is used, as will be seen later, to condition the execution of fields to special
situations.
A particular type of jump without return is the interruption of the execution of an evolute line,
obtained with field
!EB! !EB!
end block
When this special field is met, the execution of the line will stop and the execution will continue
form the next line. E.g.:
...
N10!IFHA>=10;EB!GON5!
N11...
If HA is less or equal to 10, the CNC will perform EB field and the program will continue from
N11 line; otherwise the CNC will jump to N5. (Please refer to the specific paragraph.)
As regards the return from a series of lines, the line in which EB is executed is to be considered
as completed (see the next paragraph).

5.2.2 Jump to a series of lines with return


This instruction orders Z32 to continue the execution of the program executing a series of
specified lines: after executing the last specified line, the CNC must proceed with the line following
the line that includes this instruction.
E.g.:
!GON120-N381!
asks the CNC to jump to N120 line and to continue the execution up to line 381.
After executing line 381 the CNC musts proceed from the line following the line containing this
instruction.
Inside the called lines, there can be other jumps and other calls to series of lines.
The number of the end line does not need to be greater than that of the beginning line, provided
that the end line can be reached starting from the beginning.
If the end line includes a jump (GO...), there will be no return.
E.g.:
...
N10 G0 X0
...
N20 !HA=HA+1!IFHA<10;GON15!
...
N30 !GON10-N20!
N31...
N30: lines from N10 to N20 are repeated

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

N1 Z0 M3 Z axis positioning and spindle start


N2 G0 X0 Y0 XY axes positioning: on the left bottom side
N3 G1 Z<Z-5> first descent to Z
N4 Y<Y+10> first increase in Y
N5 X100 first cut in X+
N6 Y<Y+10> second increase in Y
N7 X0 second cut in X-
N8 !GON4-N7! repeating
N9 Y0 finishing left side
N10 X100 finishing lower side
N11 Y40 finishing right side
N12 !GON2-N11! finishing second cut
N13 M2 end

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

5.2.3 Jumps to sub-programs


With this kind of instruction, Z32 temporarily left the running program, in order to executed
another program inserted in memory, that is a sub-program is called up.
!GOP10!
The called program must begin with % and end with G26 (end of sub-program).
The initial % sign does not operate a reset of memorized conditions (origins, parameters, G,
M, etc.): it only signals that the title of the sub-program has terminated and executive operations
are going to begin.
e.g.:
!GOP96!
The CNC jumps to sub-program no. 96, performs it and at the end, after G26 which closes the
sub-program 96, continues to execute the next line.
This instruction uses a jump level with return: 10 levels are available, including:
- GON...-N...
- special M
- G27C... system and users canned cycle
- G27P... permanent sub-programs
10 nesting This instruction is closely linked to parametric programming.
levels You can save in memory a standard quantity of sub-programs (from simple geometrical figures
to more complicated machining) with some parameters not defined in order to adapt to the various
conditions in which they will be used.
The operator only needs to define the parameters in the main program and then recall the sub-
program desired, without editing new instructions and using programs already tested and therefore
without errors.
In the following example we describe a simple sub-program for the external contouring of a
rectangle.
Parameters to be entered:
XA YA sides of the rectangle
XB YB values of the vertex on the left bottom side
ZA third axis working value
The main program reaches the instruction that calls for the sub-program with the correct tool on
the spindle and, therefore, the R (cutter radius), F (feed), S (speed) parameters are already
defined.
The sub-program is a general program for any machining triad (not necessarily XYZ).

182
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write

Main Program:
...

N20 XA50 YA80 XB0 YB0 ZA-20 parameters are defined


N21 !GOP90!
...
Sub-program 90:
%N1G0AA<XB-R>AB<YB-R> axes on the vertex, tool compensation
N2G1AC<ZA> descent of third axis
N3AB<AB+YA+2*R> left side
N4AA<AA+XA+2*R> upper side
N5AB<YB-R> right side
N6AA<XB-R>G26 lower side, end

5.2.4 Parameterization of jumps to lines and to sub-programs


The Z32 instructions that allow line and program jumps are usually the following:
!GOP4! jump to sub-program 4 and return
!GON45,3! jump to line N45,3 without return
!GON33-N45! jump to the N33 - N45 sequence of lines with return
Since the software version dated January 5, 1993, the line and sub-program numbers can also
be programmed using a parametric expression such as, for example:
!GOP<4+HA>!
!GON<33+HB*2>!
!GON<18,5+HC/4>-N60!
!GON<18+HC>-N<36+HC>!
!GON18-N<36+HA>!
The new programming method for the destination number is identified by angle brackets
enclosing the parametric expression. When no angle brackets are used, the old method is valid.
Any expression accepted by Z32 can be contained within angle brackets.
In the case of GOP, the result of the expression is taken as an absolute value and rounded off to
the next integer value.
In the case of GON, the destination line must start with N followed by a line number, without
any blanks either at the beginning or in the middle.
If the result of the expression is a fraction, it is rounded off to the 3rd decimal digit for results up
to 4 integers and to the 2nd digit for results up to 5 integers. The character separating the integers
from the decimals is the comma (if the destination line has a number containing a decimal point, it
will not be found).
If the rounded off result gives a sequence of zeros after the comma, this comma will also be
cancelled.
The initial zeros before the comma and the final ones after the comma are cancelled.
The following examples show some of the possible combinations.

D. ELECTRON 183
Chapter 5 Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual

Programmed jump Destination line


!GON<100>! N100
!GON<100/3>! N33,333
!GON<10000/3>! N3333,333
!GON<1000*100/3>! N3333,33
!GON<100+.001/10>! N100
!HA13!GON<48+HA>! N61

5.2.5 !GOP..-N..! and GOP..-N..-N..!


A jump to a sub-program can be performed by specifying the initial line number or even an initial
and a final line number.
This facilitates the writing of a macro.
Syntax:
!GOPx-Ny!
!GOPx-Ny-Nz!
Where "x" is the program number to which the jump is to be made, "y" is the line number where
execution is to begin, and "z" the line number where the execution is to be completed.
The three "x y z" values are numbers or the result of expressions if they are enclosed within
square brackets.
If "y" and "z" are programmed using expressions, the usual limitations on the programming of
"N" in the destination lines still stand:
There cannot be any space or any other initial character
There cannot be any space between "N" and the line number
The decimals must be separated by a comma and not by a decimal point
There cannot be more than 3 decimals.
If "P" is programmed using an expression, the number must be a positive integer. If it is not an
integer, the number will be rounded off to the nearest integer.
Examples:
!GOP3-N35!
!GOP3-N35-N82!
!GOP<HX>-N<HY>-N<HZ>!
!GOP<1+HA>-N<(HX+42)/8>-N<HY*2>! (it is hope this will never be used!)

5.2.6 Field G26, end of subprogram for DNC


With the field: G26 becomes identical to the G26 instruction of the corresponding ISO line
(and therefore terminates the current subprogram, resuming the original program), making it
possible to solve a particular problem arising in the DNC mode.

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.

5.4 READING/WRITING IN PERMANENT MEMORY


Z32 has a working memory and a permanent memory (CMOS) with battery backup.
The working memory contains the data processed by the computer when performing the
assigned program.
The permanent memory instead contains data written by the user in order to enter commands
and information.
Data included in the working memory is continuously up-dated by the computer according to the
programmed values, but they will be lost in case of power failure.
Data included in the permanent memory will not be lost when the unit is shut off, and they are
up-dated by the user.
During the execution of the program, the microprocessor reads data contained in the permanent
memory in an orderly way; it processes the data and write it in the working memory. For example, to
perform the following instruction:
HA150
the computer reads the "HA150" characters included in the permanent memory and writes the
value=150 in the location given to the HA parameter in the working memory.
The parameters described in the chapter on parameters are those of the working memory: they
are assigned with a zero value on reset and retain the values as they are processed during the
program execution; they will be lost when the unit is shut off.
When programming Z32, it is possible to read the parameter values written in the permanent
memory (such as alphanumeric characters in programs or tables) and to transfer them to the
working parameter locations.
This operation is obtained through an evolved line field. By executing this field, Z32 makes the
CMOS memorized parameter equal to that of the program.
The figure shows the general syntax of the field.

186
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write

:R means read by CMOS in the part-program parameter. :W means write in CMOS by


parameter or by part-program mathematical expression (which can be a constant in a simpler
case).
CMOS memory can represent:
parameter section
origin section
a parameter of the programmed tool description (T)
a parameter of the description of the tool on the spindle (S)
The symbol of the part-program parameter can have one or 2 characters (numbers not allowed),
or system parameters DDL and DDR, following the rules described in the paragraph concerning
parameters. That of the permanent memory is always 2 characters in the case of parameters, and
from 2 to 6 characters in the case of origins, while it may be 1 or 2 characters, or the system
parameters DDL, DDR, DLX, DLZ, TAG, TAO and TRC for the tool description.

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.

5.4.1 Multiple readings and writings


Several parameters can be read or written within a single evolved line field: the couples of
parameters symbols to be made equal are separated by the , character. E.g.:
!:RPH1=HA,H2=HB,H3=HC!
reads from H1,H2 and H3 parameter section in HA, HB and HC parameters
!:WSL=L,R=R!
writes L and R parameters in the tool line.

5.4.2 Operating origin


Mainly in general purpose sub-programs, it can be useful to read or write the operating origin (of
a given axis) without knowing which it is; that is without knowing its the identifying character.
If, instead of the identifying character, the operator enters * character, Z32 will consider it as
operating origin. e.g.:
!:ROX*=HA!
reads the operating origin on X axis, e.g. OX2, and loads it in HA parameter.
!:ROX*=HA!HA=HA-1!WOX*=HA!
moves the active origin of axis X by 1mm
Please note that, if, after activating an origin, the operator changes the operating origins section,
the programmed origin will remain that one of the old section, but origins, read and written with :R
and :W will be those ones of the new section, even if the operator reads or writes using *
character: E.g.:
N10 G37OG OX1
N11 G37OL
N12 !:ROX*=HA!
...
The content of X1 LOCAL origin will be written in HA parameter, while X1 GLOBAL origin will be
operating.

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.

5.4.3 Tool place


The tool description includes, after the # character, a number (two figures) identifying its place.
This number is not a parameter and it is not normally available to the operator. It can be transferred
to or from a parameter by entering the # character as a CMOS parameter symbol. E.g.:
!:RT#=HA!:RS#=HB!

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.

5.4.4 Reading/writing in block search procedure


Reading and writing in CMOS is normally performed during block search procedure.
This can lead to false program runs if programs modified during the previous execution are read.
E.g.:
N1!:RPHA=HA!IFHA=10;GON100!
N2!:WPHA<10>!
...
N100
...
M2
N1: the program uses the content of HA parameter to jump, or not jump, to N100.
N2: the content of HA parameter in CMOS is modified for whatever reason. If the execution is
stopped between N2 and N100, it will never be possible to start the program again, in block
search procedure, because at N1 line the CNC will jump immediately to N100.
If a program must be stopped and then started again, from any point, with a minimum effort for
the operator, the program itself has to include a trace of what it found in CMOS.
A structure similar to that illustrated in the chapter Special Performances (paragraph Block
Search Procedure) can be constructed.

5.4.5 :C and :S instructions (extension of :R and :W instructions)


The :R and :W allow the part-program to read or write CMOS parameters (origins, parameters,
tool data).
The :C and :S instructions, with the same syntax as the :R and :W instructions, offer a better
exception handling, resulting more adapt and flexible in the programming of fixed cycles or macros.
These two functions load the operation result in the HX parameter (not used by the :R and :W
instructions), triggering the program error (CN1D14, with cursor pointing after the error) only in
some cases.
:C instruction (similar to :R)
Example:

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)

G37OG (activates the origins global section, in file 126)


HA3 HB2.345 (defines parameters)
!:SOX<HA+10><HB+1>! (writes in the origins global file OX13=3.345)

190
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write

Other operations bring to the CN1D14 error. For example:


!:SPHZ=HA! error CN1D14
If the parameter HX is used as source of the writing, the error CN1D14 is issued. For example:
!:STTS=HX! error CN1D14
In all other cases the write operation is performed and the HX value indicates the operation
result with the following coding:
- If HX=0 the parameter did not exist in the tool description, or the origin was not already
present in the table, and thus they are appended
- If HX=1 the parameter already existed in the tool description, or the origin was already
present in the table, and thus its value is changed

5.4.6 :E instruction for origin deletion in CMOS


The ":E" evolved line instruction is used for deleting an origin from the active origins table (file
126 for the zero process, except variation with G37OL).
Syntax:
!EO[name_axis][number_origin]!
Example:
!:EOX1!
Deletes all X1 origins (even possibly duplicated) in the active origins table.
Also two-character axis names and origins with more than one digit are managed, for example:
!:EOX_112!
Deletes all origins 12 of the two-character X1 axis.
Can be inserted in a conditional fields of evolved line, for example:
!IF HA>0;:EOX3;EB!

5.5 OTHER

5.5.1 Function :L to upload files from a disk


The :L function (L for Load) allows the quick loading of subroutines stored on disk into the Z32
operating memory.
This command syntax, which is an evolved line field, is as follows:
!:L(Z32 file number)-(complete filename on disk)!
Example:
!:L 10 -C:\Z32\PPG\OP3244.PPG!
which requires loading in file n. 10 of the Z32 the PC file found with C:\Z32\PPG\OP3244.PPG.
Here are some rules for writing this command:
the evolved line field delimiters can be either the ! or the ; character.
:L can be preceded or followed by any number of blanks.
The file number to be installed must range between 1 and 109 inclusive, otherwise an CN1D14
PROGRAM ERROR will appear.
The file number can be the result of an expression. For example:

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.

Warning in case of multiprocessing


Z32 files are shared by all the active processes. Therefore the file that is loaded using :L can
also be used by processes other than the one requiring its loading. Before loading the file, the Z32
will check that this file is not being used (either as a main program or as a sub-program) by any of
the active processes (if it is, then a CN4F14 error will appear). However Z32 cannot foresee any of
the subsequent evolutions. It is up to the programmer to take into account the use of the file that
must be loaded in the various processes.

Warning about the sequence of the programs loaded


Z32 contains a buffer of pre-processed instructions waiting to be executed, and this list can be
very long. It has been extended to over 100 blocks to look-ahead for very far edges. The pre-
processed blocks also contain the command to display the line, which is read in the file currently in
memory at the moment this line is actually executed. If, in the meantime the file in memory was
changed (because it had been loaded by means of :L), the display of the current line will no longer
be significant. Therefore, in case of the following commands:
!:L 10 -C:\PPG\OP3244.1!GOP10!
!:L 10 -C:\PPG\OP3244.2!GOP10!
when the last lines of the OP3244.1 lines are performed, the display is incorrect as the lines are
read in the file n. 10 that now contains OP3244.2.
It would have been easy to qualify the :L operation as an operation with stop (that empties the
pre-processed buffer), but, considering that operations with stop are not always applicable (during
radius compensation, in open geometry, in the G98) this would have raised the problems of
subdividing a long file in suitable points.
It was therefore decided to accept incorrect display (that concerns only the display of the line
and not the real operation performed by the machine) to offer higher flexibility of use. There are two
ways to avoid incorrect line display:
1) by alternating the writing of a number of programs
Let us have a look at the previous example:
!: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 trick works if the programs contain functions with stop (just an M, a G4 wait) or if they are
long enough (to stay on the safe side, at least 200 blocks).
Of course, more than two programs may be involved until we obtain the desired length
2) by inserting a stop function
for example:
!:L 10 -C:\PPG\OP3244.1!GOP10!
G112
!:L 10 -C:\PPG\OP3244.2!GOP10!

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.

5.5.2 Function :L- to download files on disk


The :L- command allows downloading files from Z32 operating memory on disk. Example:
!:L-126-\FILES\ORIGINS.001!
When this line is executed, the file 126 of Z32 (origin table) is transferred from the Z32 operating
a memory to the disk named ORIGINS.001 in the \FILES directory.
Please note that the difference compared to the normal :L command is the minus sign placed
before the file number.
Some examples:
HA10 HB20
!:L-74-<HA+HB>! DOWNLOADS FILE 74 TO C:\Z32\PPG\30
!:L-74-C:\Z32\FTOP<HA/2+HB>! DOWNLOADS FILE 74 TO C:\Z32\FTOP25
All the methods of use and the alarms we already described for the :L command with positive
numbers stand except that all the files from 1 to 127 inclusive can be downloaded on the disk (while
only files from 1 to 109 inclusive can be loaded).

5.5.3 :L254 function multiple execution in DNC


The video interface programs TERMS, ZTERM or the network environment of WINDNC
program (connected as DNC manager) are necessary to implement this function.
This allows repeated execution of the same program or of different programs in DNC to
overcome the limits set by the length of individual files.
General programming format:
!:L254- PC filename!
The :L254 instruction is a stopping function, i.e. a function causing the emptying of prefetched
instruction.
This command looks like the :L command but its file number (mandatory in this case) is 254.
This file number represents the codified command to execute the subprogram resident on the
disk in DNC without an installation in the memory.
If the file number is 254:
the file is not installed in the Z32 memory but is executed in DNC. This means that the
file can have any length (compatible with the space available on the hard disk).
the file is immediately executed in DNC without the need for a GOP to follow (as required in
the case of files installed in the memory).
Different performances are possible, for example repeating the execution of a very long file in
positions that are gradually roto-traslated.
For example:
...
N2 Z30
N3 X0 Y0
N4 G1 Z0F100
N5 F300

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.

5.5.4 Parametric programming of the filename executed in DNC


In the part-program, it is possible to enter the name of the file to be executed in DNC mode
through the evolved line:
!:L254-filename!
where filename is a string of ASCII characters describing the path and the name of the file.
If useful, the file name can be changed into an expression.

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.

5.5.5 Structured DNC


WARNING: This function has not been conceived for manual programming, but for
software applications allowing a block search (or a cycle reset) by part-program areas in
automatic mode and in a networked environment - in the same way as Zterm under DOS.
However, for the sake of completeness, here follows a description of this function including
some special additional NC alarm codes for these applications.
Z32 supports a special command for structured DNC mode allowing it to partially execute a file
in DNC mode (DNC with area specification).
The use of this extension is only allowed in networked environments and with special Windows
applications. Therefore, it does not work (releasing an NC alarm) if used with current applications
(Zterm and Terms).
This function is linked to the :L254 evolved instruction, and its full syntax is:
!:L254-name_file_on_disk[pointer_startpointer_end]!
Therefore, it is possible to add, between the square brackets, the start and end pointers for the
area to be transmitted, separated by a double minus.
The pointers identify the position of the initial character in the first and the last line to be
transmitted.
The first file character has the pointer = 1 (not = 0!).
If the two pointers are identical, a single line will be transmitted.

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

5.5.6 :P instruction prints strings and parameter values to video

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

5.5.7 :D instruction prints strings and parameter values to video


Displaying data on the screen using the advanced line instruction :P has the following limits:
there is a conflict with the PLC displays because the string is printed in the same screen area
the print is not synchronized with the real position of the subroutine because of the pre-
processed instruction buffer.
The :D instruction can be used when it is necessary to overcome these limitations (mnemonic
Display) may replace :P. This instruction maintains the same syntax but with none of the above
limits. Printing with :D is performed in the special display areas (the ones enabled by pressing
CTRL-R V) and that are seldom used. If the CTRL-R V display areas are used, the text associated
to :D is temporarily not displayed.
The syntax of :D instruction is the same as :P, the only difference being the special field opening
command becoming :D (D comma Display):
!:D /. n1 - n2 string [expression] ...!
Examples:
!:D0-30 "HA="[HA]" HB="[HB]!
Displays the two parameters HA and HB, with a description.
!IF HA<0;:D0-60"WRONG HA = "[HA]!
Displays only if HA<0
!:D20-80"Result: "[12*4-PAR[18]+CS(HB-30)]!
Displays the value of the expression
!IF HA>40;:D /R!
If HA>40 displays of :D are cancelled.
HA100,123
!:D/.0-20 PARAM. HA=[HA]!
Will display the line: PARAM. HA=100.123

198
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 - Evolved lines, Jumps, Conditioning, Read/Write

5.5.8 :F instruction string writing to file


The :F evolved instruction behaviour is quite similar to that of :P and :D, with the difference that
the result, rather than being written to video is "appended" to a Z32 file.

The normal syntax is:


!:F /. nfile"string"[expression]"string"...!
Where:

/. = to format data with a point instead of a comma (optional)

nfile = Z32 file number (from 1 to 99)

string = string of alphanumerical ASCII characters enclosed in double quotes

[expression] = part-program expression

The string immediately follows the required file, the expression is calculated and immediately
follows the required file.

For more details, refer to the syntax of fields :P and :D.

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

Each :F field refers to a full line.

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

5.5.9 DOC files for block search with optional block


A program line starting with / is executed by Z32 only if enabled by the special selector
(optional block).
If during the program execution the selector status is changed by the operator according to his
needs, a successive block search will be impossible because even though the operator can
remember the choices made during the execution, he will find it practically impossible to command
the selector as quickly as necessary.
The new version allows the generation of a DOC file storing the commands imparted by
operator during the program execution. These data are stored in this DOC file and can be used in
block searches to repeat the operators choices.
To ensure compatibility with the previous version, the new execution and block search mode is
enabled by a special command included in the part-program. Without this command, it will work the
same way as before, both in the execution and the block search modes.
The DOC file function in execution mode (i.e the file is written including the operators choices),
is different from the block search mode (i.e. the operators choices are read by the file).
The events associated to the DOC file are:
- initial enable command
- line with optional block
- program section start
DOC file enabling
The DOC file is enabled via an evolved line field:
!DOC>nnn!
DOC is the command enabling the DOC file
> introduces the Z32 file in the storage area of documentation data
nnn is the file number
For example:
!DOC>102!
Requires the enabling of DOC functions in file # 102
Any file number from 1 to 109 is accepted.
In order to record all the operators choices, the DOC file should be enabled at the programs
start.
During the execution, the effects of this command are:
- the destination file, if existing, is deleted
- a new destination file is created with a characteristic initial string
Here is typical initial string:
DOC FILE PRG NR 004 20.08.99 18:47
The following fields are included in the initial string:
DOC FILE PRG NR fixed ASCII string typical of the DOC file
004 number of the current program
20.08.99 date, in the dd.mm.yy format
18:47 time, in the hh:mm format
The current file is the base file (launched with the select/choose command), even if other
subprograms or DNC files are currently running.

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

Example of a part-program with its DOC file


Example of a part-program with DOC file enabled, incorporated into file # 4:
TEST FILE DOC%
!DOC>102!
F500
G1X0Y0Z0
/X10
Y5
/X25
Y10
:4567
G0X0Y0Z0
/G1X20
Y10
M2
Once this part-program has been executed, with optional block disabled, the file # 102 (DOC
file) will be the following:
DOC FILE PRG NR 004 21.08.99 16:37
0
0
:04567
0
The 0s corresponding to optional blocks are transformed into 1 if the optional block selector
is active during the execution.

5.5.10 INPUT instruction - Entering part-program parameters from the keyboard


With this instruction, the operator can be prompted for entering a parameter during the
execution of a part-program.

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.

For example, this line:

HA<IN:CUT DEPTH>

Opens an operators dialog box of the type:

<0 > 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:

<5.324 > IN:CUT DEPTH

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 cursor is placed after the last digit.

The operator can delete one or more digits and substitute them to reach the desired value.

The dialog occurs through the command line.

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:

<5.234 > IN:comment

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:

- ENTER confirms the already existing value.

- 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.

In the value editing mode:

- ENTER confirms the value entered

- 0 1 2 3 4 5 6 7 8 9 + - , . are accepted for the composition or modification of the value.

- ESC or DEL will delete all, restarting the input procedure.

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

6. STRUCTURED PROGRAMMING FUNCTIONS

6.1 STRUCTURED PROGRAMMING


The instructions of Z32 which interrupt the sequential implementation of the program lines are:

!GON! Jump to a line with no return

!GON-N! Jump to a series of lines with return

!GOP! Jump to a sub-program

!GOP-N! Jump to a full line of a sub-program

!GOP-N-N! Jump to a series of lines within a sub-program

Some "structured programming" instructions, which were supplemented to the existing


instructions and can, with some limitations that we will see, be contained in part-programs residing
in Z32 working memory (not longer than 64K bytes), and also in part-programs performed in DNC
(and therefore of any length), have been added.

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.

Standard rules for structured instructions are:

- before and after "--" there may be any number of blanks.

- they may contain comments, introduced by the character ";"

6.1.1 IF - ELSEIF - ELSE - END IF structure


Permits the conditional implementation of a set of instructions.
Complete syntax:
-- IF condition ; comment
instructions
-- ELSEIF condition ; comment
instructions
-- ELSE ;comment
instructions
-- END IF ;comment
where:
- condition has three possible formats:
1) condition = expression1 compared to expression2
IF implementation depends on the comparison between two expressions.

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.

- comparison are the operators:

< lower than (with sign)

= equal

> higher than (with sign)

<= lower than or equal

>= higher than or 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

6.1.2 DO - EXIT DO - LOOP structure


Permits the conditioned repetition of a series of instructions.
Complete syntax:
-- DO ;comment
instructions
-- EXIT DO IF condition ;comment
instructions
-- LOOP [IF condition] [number] [<expression>] ;comment
where:
- condition consists of expression 1 in comparison to expression 2 as for the IF. The
conditions "/" and "//" are not permitted which are however possible with the IF
- the EXIT DO is optional
- the LOOP is compulsory
- IF condition after EXIT DO and after LOOP is optional
- number repetition of DO-LOOP cycle for the specified number of times (optional)
- <expression> repetition for the number of times specified by the result of the expression,
evaluated only the first time.
- the blanks between EXIT DO IF and between LOOP IF are optional (the following are also
accepted EXITDOIF, EXIT DOIF, LOOPIF)
- the number following the LOOP instruction indicates the number of times the jump is
executed, therefore the DO-LOOP cycle is executed one time more than specified (first time and
the number specified)
- the number must be positive, otherwise, the alarm CN1D14 PROGRAM ERROR is issued
- it is possible to program the number also with the result of an expression: --LOOP <(100-
HA)/2>. The expression is evaluated only once and the result is stored and used like it were directly
programmed.
- for the expression (unlike the direct programming with a number) also non integer or negative
results are allowed, with the following rules:
if the result is not an integer, the result is approximated to the nearest integer
if the resulting integer is zero or negative, the DO-LOOP cycle is not repeated (executed only the
first time)
This tolerance with abnormal results is useful because it is easy to have non integer results, due
to the binary format for numbers (the expression 10*0.2 gives to a not integer binary result), while
negative results may be useful in case of complex control conditions.
Basic examples:
G0 X0 Y0
Z0
--DO

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.

6.1.3 GOTO - LN structure


Permits the jumping of a series of instructions.
Syntax:
-- GOTO LN expression ;comment
instructions
-- LN expression ;comment
Where:
- expression is any expression implemented by Z32 ( the most simple is a number)
- the blanks between GOTO and LN are optional (GOTOLN is also accepted)
- the ";" and the comments are optional
After GOTO all the instructions are missed up to the destination line LN, which features a
numerical expression identical to that of the GOTO expression.
The destination line LN can only be forward in the program as compared to the GOTO line.
Example:
--GOTO LN 20 ;comment
instructions
--LN 20 ;comment
Beware of expressions that contain non-whole numbers, which could cause an unexpected
reaction.
For example, the following do not work:
-- GOTO LN 0.9 ;comment
instructions
-- LN 1-0.1 ;this line is not found!
The explanation is that the expressions are evaluated by Z32 in a truncated binary floating point
format (not rounded), and in this format the simple decimal numbers 0,9 and 0,1 are periodic (they
have an infinite number of decimals) and so they can only be represented in approximated form.
It is rather as if with decimal notation with 4 figures one wanted to compare the number 2/3 with
3-1/3
2/3 is worth 0.6666
1/3 is worth 0.3333
3-1/3 is worth 0.6667, which is different to 0.666.

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.

6.1.4 DEFINE - END DEFINE structure


Permits the sending of a set of instructions to Z32 in the form of a file.
Syntax:
-- DEFINE P number ;comment
instructions
-- END DEFINE ;comment
where:
- number is whole and between 1 and 119 inclusive, which defines the entire Z32 file in which
the instructions container in DEFINE must be written.
- it is not possible to overwrite the program or sub-program currently in progress to which return
is necessary (for example if sub-program 25 is in progress which is recalled with an !GOP! from
sub-program 20, which is in turn recalled with a !GOP! from program 1, files 1, 20, 25 cannot be
written on).
- characters ";" and the comments are optional
- the blanks are optional (DEFINEP ENDDEFINE are also accepted)
Example:
-- DEFINE P32 ;fixed cycle of special drilling
SPECIAL DRILLING CANNED CYCLE %
G0 Z<Z-30>
G1 Z<Z-20>
G4 TT.3
G0 Z<Z+50>
G26
-- END DEFINE
This structure is principally destined for evolved editors, inserted in a part-program (for example
to be sent in DNC) which may be macro or fixed cycle type which may not be recovered amongst
the macro and fixed cycles of the system.
One DEFINE cannot be inserted inside another DEFINE, otherwise the following alarm condition
is generated CN6C14 "DEFINE INSIDE A DEFINE".
If a sub-program is defined with a number of > 119, or a program or sub-program in progress or
one of the programs to which return must be made, the following error occurs CN7714 "NON-
EDITABLE FILE ERROR".
If the file number is irregular (0 or with decimals or negative ) the following alarm condition
occurs CN1D14 "PROGRAM ERROR"
If an END DEFINE is found with DEFINE not open, the following alarm condition occurs CN6A14
"DEFINE END WITHOUT DEFINE"
There may be any kind of instructions inside a DEFINE, both structured and non-structured(with
the exception of --OUT necessary to check the closure of DEFINE), but which may even be
incorrect, and which are completely ignored during this writing stage in the Z32 file. Should there be
any implementation errors they will be highlighted when the sub-program is executed.

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.

6.1.5 OUT instruction


Permits alarm to occur should the operation proceed beyond the end of the file or DNC program.
Syntax:
-- OUT

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

6.1.6 WAIT instruction


The structured "WAIT" function (to be used by the end user according to the specifications
provided by the manufacturer) is basically as follows:
--WAIT condition
where:
- condition is of type expression1 comparison expression2
in which expression1 and expression 2 are the mathematical expressions accepted by, and the
comparison is expressed by one of the following conditions "<", ">=", "=", ">=", ">". For example:
--WAIT PAL[20] = 0
Where the expressions are reduced to their basic format (a parameter and a constant).
The purpose of this instruction, which halts the reading of the part program, until the condition
has been assessed is to synchronize the part-program with the machine PLC wasting as little time
as possible.
The WAIT instruction is also compatible with the open profiles, correction, radius etc but the
PLC engineer needs to take all the necessary precautions which take into account the fact that the
reading of the part-program may be many blocks ahead in relation to implementation.

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.

6.2 Temporary subroutines


To permit improved control of the programs and sub-programs, of the macros, and the fixed
cycles; an important new resource has been introduced for the CNC Z32: known as the, which for
the sake of brevity we shall call subtemp.
This resource has been specifically developed for use on the user interface Z-flash, but it is also
available for manual programming mode.
The subtemp are internal files of Z32 and are very similar in structure to the CMOS files, but with
some important differences.
We shall in the following paragraphs describe the features of the subtemp.
1) A subtemp is created with a --DEFINE and belongs to the part-program that generates it
The only way to generate a subtemp is from the inside of a part-program with the structured
instructions --DEFINE S
For example:
...
-- DEFINE S20
(SIMPLE FIXED DRILLING CYCLE
G0 Z<HA>
G1 Z<HB>
G0 Z<HA>
G26
-- END DEFINE
...
It will be noted that this DEFINE flanks that already introduced for the CMOS files (DEFINE P):
one of the main differences being that the subtemps are new resources, which do not therefore
affect the structure of the CMOS installation files already consolidated.
A subtemp is generated by a part-program and follows it lifeline: it is, as the name states
temporary as it disappears at the end of the part-program, or more logically when the machine is
switched off.
2) Up to 64 subtemps are possible for each process, how to cancel a subtemp
Unlike the CMOS files which, once created, can be accessed from any process, a subtemp is
accessible only from the part-program and the process that generated it.
For example in a multi-process machine, if two part programs are being undertaken at the same
time, one on process 0 and one on process 1, the two part-programs may define two different
subtemps with the same number (i.e. DEFINE S3) without the two subtemps interfering with each
other.
Up to 64 subtemps are possible for each process (numbered from 1to 64, zero excluded).

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

7. Z32 FIXED CYCLES AND MACROS


This chapter describes the Z32 macros and standard canned cycles. The cycles and processes
described here apply to Z32 T109-8B versions or later.
Cycles and machining are recalled through the functions:
G800 FIXED (CANNED) CYCLES
G801 POSITIONING MACROS
G802 MACHINING MACROS

7.1 Z32 FIXED CYCLES (G800)


The function G800 allows to program the system fixed cycles.
The system fixed cycles are unchangeable system subprograms, activated by programming:
G800 K..
Where the K letter must be followed by the number identifying the desired cycle.
When a fixed cycle has been activated, it is automatically executed at the end of each
programmed G0 (RAPID) positioning. Movements executed in feed dont trigger the fixed cycle
execution.
The programming of G800 is as follows:

Parameter passing:
All necessary parameters are specified by programming them on the same line containing the
activation of G800. In the program line containing a G800 activation, it is possible to program only
parameters related to fixed cycles programming.
For example, with reference to the cycle G800K1, it is possible to set the parameters by
programming:
G800 MHA0 MHB-20 MHC10
An example of not correct programming is the following:
G800 MHA0 MHB-20 MHC10 F1000
The parameter F is not directly programmable on the G800 line, so a correct writing is as
follows:
F1000
G800 MHA0 MHB-20 MHC10

Fixed cycle activation


To recall and activate a fixed cycle, it is necessary to program on the G800 line also the K
parameter used to choose the cycle:
G800K1 MHA0 MHB-20 MHC10
Parameter programming and fixed cycle activation may happen on the same line or on different
lines.
As an example, all following syntaxes are equivalent:

D. ELECTRON 219
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

G800K1 MHA0 MHB-20 MHC10 (parameter programming and cycle activation)


and
G800 MHA0 MHB-20 MHC10 (parameter programming)
G800K1 (cycle activation)

Fixed cycle deactivation


The deactivation of a fixed cycle activated with G800 is obtained by programming:
G800K0
After a fixed cycle deactivation, the cycle parameters are cleared; if the recalling of a new fixed
cycle is desired, all necessary parameters must be programmed anew.

Fixed cycle suspention


The function G27X suspends the active fixed cycle. G27X is valid only in the block where
programmed.
Example:
...
G800 MHA0 MHB-20 MHC10 K1 (enables the fixed cycle)
G0 X100 Y100 (executes fixed cycle)
G27X G0 X200 (doesnt execute fixed cycle)
G0 X200 Y200 (executes fixed cycle)
...

Optional parameters management


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

220
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

7.1.1 G800K1: DRILLING

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

Optional parameters for centering:


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

Optional parameters for dwell at hole end:


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

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

7.1.2 G800K2: DEEP DRILLING WITH CHIP BREAKAGE

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

Optional parameters for centering:


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

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

MHI MHD MHT

MHR
MHI

MHB

222
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

7.1.3 G800K3: DEEP DRILLING WITH CHIP EXTRACTION

Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHI: depth increment before retraction for chip extraction.
This increment is reduced by 10% at every movement up to a value of 50% of starting
MHI value, then the increments are constant.
MHZ: chip extraction position

Optional parameters for centering:


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

Optional parameters for repositioning:


(MHS): safety distance for in hole repositioning.
If MHS = 0, a default distance of 0.5mm is assumed.

Optional parameters for dwell time at extraction position:


(MHT): optional dwell at chip extraction position MHZ

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

7.1.4 G800K4: TAPPING

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

Optional parameters for dwells with compensating chuck


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

Optional parameter for managing the output speed


(MHR): multiplicative factor of the spindle speed during the exit from the hole. In the case of
rigid tapping the admitted values are: 0.5 <= MHR <= 4. Different values are ignored.

Description of tapping with compensating chuck cycle: (MHM = 1)


1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Feed movement up to MHB position, with F = S * MHP feed
4. Spindle stop
5. Dwell for MHT seconds
6. Spindle rotation inversion
7. Dwell for MHT seconds
8. Feed return to MHA position
9. Rapid return to MHC position, if different from MHA
10. Spindle rotation restore

Description of rigid tapping cycle: (MHM = 0)


1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Wait for spindle zero crossing
4. Tapping with MHP pitch and Z axis synchronized with the spindle up to MHB position
5. Spindle rotation inversion
6. Return to MHA position with MHP pitch
7. Rapid return to MHC position, if different from MHA
8. Spindle rotation restore

MHP
G0 MHC

MHA

MHB

MHT MHW

224
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

7.1.5 G802K5: REAMING

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

Optional parameters for dwell at hole end:


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

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

7.1.6 G800K6: BORING

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

Optional parameters for spindle orientation:


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

Optional parameters for dwells:


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

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

7.1.7 G802K7: DEEP DRILLING WITH CHIP BREAKAGE AND EXTRACTION

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

Optional parameters for centering:


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

Optional parameters for repositioning:


(MHS): safety distance for in hole repositioning.
If MHS = 0, a default distance of 0.5mm is assumed.

Optional parameters for dwells:


(MHW): dwell time at chip extraction position HZ

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

7.1.8 G800K8: TWO ZONES DRILLING WITH GAP

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

Optional parameters for centering:


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

Optional parameters for chip breaking:


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

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

7.1.9 G800K9: THREE ZONES DRILLING

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

Optional parameters for low zone:


(MHV): end middle zone start low zone position
If MHV = 0 no low zone exists. Middle zone ends at MHB
(MHK): feed inside middle zone.
(MHH): Speed inside low zone. If MHH=0, the low zone speed is equal to the middle zone
speed

Optional parameters for centering:


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

Optional parameters for chip breaking:


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

Optional parameters for speed change:


(MHS): retraction for speed change

D. ELECTRON 229
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

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

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

feed MHF feed MHJ


MHC
feed F feed MHK
G0
MHA

MHD
MHI
MHU
MHI
MHV

MHI
MHB

230
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

7.1.10 G800K10: INTERNAL SPIRAL MILLING-BORING

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

Optional parameters for pass management:


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

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

MHD MHD < 0

MHC
MHA

MHK

MHB

D. ELECTRON 231
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

7.1.11 G800K11: EXTERNAL SPIRAL MILLING-BORING

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

Optional parameters for pass management:


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

Optional parameters for approach:


(MHS): starting point distance from approaching point
If MHS=0 a default value of 1mm is assumed.

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

7.2 Z32 POSITIONING MACROS (G801)


The function G801 allows to program positioning macros.
The positioning macros are system, unchangeable subprograms activated by programming
G801 K..
Where the K letter must be followed by the number identifying the desired cycle.
The programming of a positioning macro starts the execution of all described positionings.
Normally these macros are used in combination with fixed cycles or machining macros (G802),
used as aspecial kind of fixed cycle.
The programming of G801 is as follows:

Parameter passing:
All necessary parameters are specified by programming them on the same line containing the
activation of G801. In the program line containing a G801 activation, it is possible to program only
parameters related to fixed cycles programming.
For example, with reference to the cycle G801K1, it is possible to set the parameters by
programming:
G801 MPX0 MPY0 MPJ10 MPK5 MPN5

An example of not correct programming is the following:


G801 MPX0 MPY0 MPJ10 MPK5 MPN5 F1000

The parameter F is not directly programmable on the G801 line, so a correct writing is as
follows:
F1000
G801 MPX0 MPY0 MPJ10 MPK5 MPN5

Activating a positioning macro


To recall and activate a positioning macro, it is necessary to program on the G801 line also the
K parameter used to choose the macro:
G801K1 MPX0 MPY0 MPJ10 MPK5 MPN5

Parameter programming and macro activation may happen on the same line or on different
lines.
As an example, all following syntaxes are equivalent:
G801K1 MPX0 MPY0 MPJ10 MPK5 MPN5 (parameter programming 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

Optional parameters management


In the macros definition some parameters defined as optional are present.
It is possible not to program all optional not desired parameters.
The available positioning macros may be used in two modes:

As positioning connected to a fixed cycle


If on every macro point the execution of a fixed cycle is desired, the fixed cycle must be
activated before the positioning macro recall. The fixed cycle must be deactivated (G27 C0) after
calling the positioning macro, or after all positioning where the fixed cycle must be executed.

As positioning connected to any machining


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

234
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

7.2.1 G801K1: LINE - STARTING POINT AND INCREMENTS

Mandatory parameters:
MPX, MPY: starting point coordinates
MPJ, MPK: increments on the first and second axis of the plane
MPN: number of points

Optional parameters for machining position:


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

Optional parameters for positioning skipping:


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

MPK

MPX 0

MPJ

MPY

7.2.2 G801K2: LINE - STARTING POINT, ANGLE AND POINT DISTANCE

Mandatory parameters:
MPX, MPY: starting point coordinates
MPG: line slope angle
MPP: distance between points
MPN: number of points

Optional parameters for machining position:


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

Optional parameters for positioning skipping:


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

D. ELECTRON 235
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

P
MP

0 MPG
MPX

MPY

7.2.3 G801K3: LINE - STARTING AND END POINT

Mandatory parameters:
MPX, MPY: starting point coordinates
MPA, MPB: end point coordinates
MPN: number of points

Optional parameters for machining position:


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

Optional parameters for positioning skipping:


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

MPB

MPX 0
MPA

MPY

236
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

7.2.4 G801K4: GRID - ROW AND COLUMN INCREMENTS

Mandatory parameters:
MPX, MPY: starting point coordinates
MPJ, MPK: row increments
MPV, MPW: column increments
MPN: number of points in a row
MPM: number of points in a column

Optional parameters for machining position:


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

Optional parameters for positioning skipping:


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

MPV
MPJ
MPK

MPW
MP M

MPY
MPN

0 MPX

7.2.5 G801K5: GRID - STARTING POINT, DISTANCES AND ANGLES

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

Optional parameters for machining position:


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

D. ELECTRON 237
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

Optional parameters for positioning skipping:


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

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

Optional parameters for machining position:


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

Optional parameters for positioning skipping:


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

MPD
MP M

MPB
MPY
MPN

0 MPX MPA MPC

238
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

7.2.7 G801K7: CIRCLE - INITIAL ANGLE AND TOTAL INCREMENT

Mandatory parameters:
MPX, MPY: circle center coordinates
MPC: circle radius (positive or negative value)
If MPC is positive, positioning happens counterclockwise
If MPC is negative, positioning happens clockwise
MPA: initial angle
MPN: number of points

Optional parameters for arc length


(MPL): total increment (positive value)
If MPL = 0 or MPL = 360 the points are spaced along the whole circumference

Optional parameters for machining position:


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

Optional parameters for positioning skipping:


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

Optional parameters for positioning type:


(MPW): movement type between points
MPW = 0 : linear movement
MPW = 1 : circular movement

MPL

MPA

MPY

MPC

0 MPX

D. ELECTRON 239
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

7.2.8 G801K8: CIRCLE - INITIAL ANGLE AND ANGULAR DISTANCE

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

Optional parameters for arc length


(MPP): angular distance between points (positive value)
If MPP = 0 the points are spaced along the whole circumference, starting from the
initial angle.

Optional parameters for machining position:


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

Optional parameters for positioning skipping:


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

Optional parameters for positioning type:


(MPW): movement type between points
MPW = 0 : linear movement
MPW = 1 : circular movement

MPP

MPA

MPY

MPC

0 MPX

240
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

7.2.9 G801K9: CIRCLE - INITIAL AND FINAL ANGLE

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

Optional parameters for machining position:


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

Optional parameters for positioning skipping:


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

Optional parameters for positioning type:


(MPW): movement type between points
MPW = 0 : linear movement
MPW = 1 : circular movement

M
PB
M PA

MPY

MPC

0 MPX

D. ELECTRON 241
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

7.2.10 G801K10: RECTANGLE - CENTER AND PITCH

Mandatory parameters:
MPX, MPY: rectangle center coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPP: distance between points on the base
MPM: number of points on rectangle height
MPQ: distance between points on the height

Optional parameters for machining position:


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

MPP
MPQ

MPG

MPY
MP
M

N
MP

MPX
0

7.2.11 G801K11: RECTANGLE - CENTER AND SIDES

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

Optional parameters for machining position:


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

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

7.2.12 G801K12: RECTANGLE - CORNER AND PITCH

Mandatory parameters:
MPX, MPY: lower left corner coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPP: distance between points on the base
MPM: number of points on rectangle height
MPQ: distance between points on the height

Optional parameters for machining position:


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

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

7.2.13 G801K13: RECTANGLE - CORNER AND SIDES

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

Optional parameters for machining position:


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

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

7.3 Z32 MACHINING MACROS (G802)


The function G802 allows to program machining macros.
The machining macros are system, unchangeable subprograms activated by programming
G802 K..
Where the K letter must be followed by the number identifying the desired cycle.
The programming of G802 is as follows:

Parameter passing:
All necessary parameters are specified by programming them on the same line containing the
activation of G802. In the program line containing a G802 activation, it is possible to program only
parameters related to fixed cycles programming.
Unlike G800 and G801, with G802 it is possible to program the positions of continuous axes, in
order to define the macro reference point (i.e. a pocket center).
For example, with reference to the cycle G802K1, it is possible to set the parameters by
programming:
G802 X10 Y10 MMA0 MMB-20 MMC10
An example of not correct programming is the following:
G802 X10 Y10 MMA0 MMB-20 MMC10 F1000

The parameter F is not directly programmable on the G802 line, so a correct writing is as
follows:
F1000
G802 X10 Y10 MMA0 MMB-20 MMC10

Activating a machining macro


To recall and activate a fixed cycle, it is necessary to program on the G802 line also the K
parameter used to choose the cycle:
G802K1 X10 Y10 MMA0 MMB-20 MMC10

Parameter programming and fixed cycle activation may happen on the same line or on different
lines.
As an example, all following syntaxes are equivalent:
G802K1 X10 Y10 MMA0 MMB-20 MMC10 (parameter programming and macro
activation)
and
G802 X10 Y10 MMA0 MMB-20 MMC10 (parameter programming)
G802K1 (cycle activation)
At the end of machining the macro parameters are cleared, if the recalling of a new machining is
desired, all necessary parameters must be programmed anew

Optional parameters management


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

D. ELECTRON 245
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

Using a machinig macro as a fixed cycle


By programming the parameter HX1 on the same line as G802 K.. it is possible to use a
machining macro like a fixed cycle, thus allowing the macro replication on more than one point.
For example, it is possible to combine a machining macro, used as a fixed cycle, with a
positioning macro.
When a machining macro is used as a fixed cycle, the macro reference point programmed
through the axes positions (i.e. a pocket center) will be no more set on the same line as G802,
because the macro positioning point is determined by succeeding positioning.

Example:
G802 MMA0 MMB-30 MMC10 MMD60
G802K1 HX1 MMK1 MME2 MMW1 MMQ4
Please note that the pocket center positions are not programmed.

The fixed cycle deactivation is programmed by the function


G802K0
After a fixed cycle deactivation, the cycle parameters are cleared; if the recalling of a new fixed
cycle is desired, all necessary parameters must be programmed anew.

A fixed cycle may be suspended by the function G27X (see introduction to G800 fixed cycles).

By using a machining macro connected with a positioning macro, it is possible to use the
machining rotation (parameter MHR).

246
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

7.3.1 G802K1: CIRCULAR POCKETS ROUGHING

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.

At the end of machining a retract up to MMC position is executed.

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 for circular pockets roughing macro:

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

Optional parameters for taper:


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

D. ELECTRON 247
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

Optional parameters for sinking feed:


(MMF): sinking feed If not programmed, or if equal to 0, the sinking feed assumes the F
value.

Optional parameters for ramp sinking:


(MMW): ramp sinking:
MMW=0: sinking on pocket center, inside a pre-hole.
MMW=1: ramp sinking , with maximum slope MMQ
(MMQ): maximum slope of sinking ramp. If MMQ=0, the sinking is executed as a single
movement.

Optional parameters for pass overlapping:


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

Optional parameters for movement direction:


(MMJ): movement direction:
MMJ=0 counterclockwise (concordance)
MMJ=1 clockwise (discordance)

Optional parameters for machining allowance:


(MMS): allowance
(MMV): allowance at end of pass:
MMV=0 leaves allowance unmachined
MMV=1 eliminates allowance

Optional parameters for non cylindrical tools:


(MMU): insert radius of toroidal tools
The R parameter contains the tool radius, while the MMU parameter the insert radius:
MMU=0, cylindrical tool
MMU<R, toroidal tool
MMU=R, spherical tool

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

7.3.2 G802K2: RECTANGULAR POCKET ROUGHING - POCKET CENTER

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.

At the end of machining a retract up to MMC position is executed.

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

MMK: pass depth

Optional parameters for pocket rotation:


(MMG): pocket rotation angle.

Optional parameters for taper:


(MMN): taper (delivery angle). Must be comprised between 0 and 80 degrees.
(MMX): fillet management with taper pockets:
MMX=0 variable fillets
MMX=1 constant fillets

Optional parameters for sinking feed:


(MMF): sinking feed If not programmed, or if equal to 0, the sinking feed assumes the F
value.

Optional parameters for ramp sinking:


(MMW): ramp sinking:
MMW=0: sinking on pocket center, inside a pre-hole.
MMW=1: ramp sinking , with maximum slope MMQ
(MMQ): maximum slope of sinking ramp. If MMQ=0, the sinking is executed as a single
movement.

Optional parameters for pass overlapping:


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

Optional parameters for movement direction:


(MMJ): movement direction:
MMJ=0 counterclockwise (concordance)
MMJ=1 clockwise (discordance)

Optional parameters for machining allowance:


(MMS): allowance
(MMV): allowance at end of pass:
MMV=0 leaves allowance unmachined
MMV=1 eliminates allowance

Optional parameters for non cylindrical tools:


(MMU): insert radius of toroidal tools
The R parameter contains the tool radius, while the MMU parameter the insert radius:
MMU=0, cylindrical tool
MMU<R, toroidal tool
MMU=R, spherical tool
MMP
MMG
MMR
AA, AB

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

7.3.3 G802K3: RECTANGULAR POCKET ROUGHING - CORNER

The machining cycle of this macro is very similar to the roughing macro where the pocket
center is known. The only difference is in the programmed coordinates: those of a pocket
corner, instead of pocket center.

In this case the AA and AB parameters represent 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

Optional parameters for pocket rotation:


(MMG): pocket rotation angle.

Optional parameters for taper:


(MMN): taper (delivery angle). Must be comprised between 0 and 80 degrees.
(MMX): fillet management with taper pockets:

D. ELECTRON 251
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

MMX=0 variable fillets


MMX=1 constant fillets

Optional parameters for sinking feed:


(MMF): sinking feed If not programmed, or if equal to 0, the sinking feed assumes the F
value.

Optional parameters for ramp sinking:


(MMW): ramp sinking:
MMW=0: sinking on pocket center, inside a pre-hole.
MMW=1: ramp sinking , with maximum slope MMQ
(MMQ): maximum slope of sinking ramp. If MMQ=0, the sinking is executed as a single
movement.

Optional parameters for pass overlapping:


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

Optional parameters for movement direction:


(MMJ): movement direction:
MMJ=0 counterclockwise (concordance)
MMJ=1 clockwise (discordance)

Optional parameters for machining allowance:


(MMS): allowance
(MMV): allowance at end of pass:
MMV=0 leaves allowance unmachined
MMV=1 eliminates allowance

Optional parameters for non cylindrical tools:


(MMU): insert radius of toroidal tools
The R parameter contains the tool radius, while the MMU parameter the insert radius:
MMU=0, cylindrical tool
MMU<R, toroidal tool
MMU=R, spherical tool

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

7.3.4 G802K4: CIRCULAR POCKETS FINISHING

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.

List of parameters for circular pockets finishing macro:

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

Optional parameters for pocket wall orientation:


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

Optional parameters for approaching distance:


(MMQ): profile approaching and retraction distance. If not programmed, or if equal to 0, a
value of 2mm is assumed.

D. ELECTRON 253
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

Optional parameters for taper:


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

Optional parameters for sinking feed:


(MMF): sinking feed If not programmed, or if equal to 0, the sinking feed assumes the F
value.

Optional parameters for spiral milling:


(MMW): spiral milling
MMW=0 finishing with constant depth passes
MMW=1 spiral finishing (only for cylindrical pockets, MMN=0)

Optional parameters for movement direction:


(MMJ): movement direction:
MMJ=0 counterclockwise (concordance)
MMJ=1 clockwise (discordance)

Optional parameters for machining allowance:


(MMS): allowance

Optional parameters for non cylindrical tools:


(MMU): insert radius of toroidal tools
The R parameter contains the tool radius, while the MMU parameter the insert radius:
MMU=0, cylindrical tool
MMU<R, toroidal tool
MMU=R, spherical tool

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

7.3.5 G802K5: RECTANGULAR POCKET FINISHING - POCKET CENTER

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.

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.

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

Optional parameters for pocket wall orientation:


(MMV): defines the wall where the approaching and retraction movements from pocket
profile are made:

D. ELECTRON 255
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

MMV=0: right wall


MMV=1: left wall

Optional parameters for approaching distance:


(MMQ): profile approaching and retraction distance. If not programmed, or if equal to 0, a
value of 2mm is assumed.

Optional parameters for pocket rotation:


(MMG): pocket rotation angle.

Optional parameters for taper:


(MMN): taper (delivery angle). Must be comprised between 0 and 80 degrees.
(MMX): fillet management with taper pockets:
MMX=0 variable fillets
MMX=1 constant fillets

Optional parameters for sinking feed:


(MMF): sinking feed If not programmed, or if equal to 0, the sinking feed assumes the F
value.

Optional parameters for spiral milling:


(MMW): spiral milling
MMW=0 finishing with constant depth passes
MMW=1 spiral finishing (only for cylindrical pockets, MMN=0)

Optional parameters for movement direction:


(MMJ): movement direction:
MMJ=0 counterclockwise (concordance)
MMJ=1 clockwise (discordance)

Optional parameters for machining allowance:


(MMS): allowance

Optional parameters for non cylindrical tools:


(MMU): insert radius of toroidal tools
The R parameter contains the tool radius, while the MMU parameter the insert radius:
MMU=0, cylindrical tool
MMU<R, toroidal tool
MMU=R, spherical tool

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

7.3.6 G802K6: RECTANGULAR POCKET FINISHING - CORNER

The machining cycle of this macro is very similar to the finishing macro where the pocket
center is known. The only difference is in the programmed coordinates: those of a pocket
corner, instead of pocket center.

In this case the AA and AB parameters represent 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

Optional parameters for pocket wall orientation:


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

Optional parameters for approaching distance:


(MMQ): profile approaching and retraction distance. If not programmed, or if equal to 0, a
value of 2mm is assumed.

D. ELECTRON 257
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

Optional parameters for pocket rotation:


(MMG): pocket rotation angle.

Optional parameters for taper:


(MMN): taper (delivery angle). Must be comprised between 0 and 80 degrees.
(MMX): fillet management with taper pockets:
MMX=0 variable fillets
MMX=1 constant fillets

Optional parameters for sinking feed:


(MMF): sinking feed If not programmed, or if equal to 0, the sinking feed assumes the F
value.

Optional parameters for spiral milling:


(MMW): spiral milling
MMW=0 finishing with constant depth passes
MMW=1 spiral finishing (only for cylindrical pockets, MMN=0)

Optional parameters for movement direction:


(MMJ): movement direction:
MMJ=0 counterclockwise (concordance)
MMJ=1 clockwise (discordance)

Optional parameters for machining allowance:


(MMS): allowance

Optional parameters for non cylindrical tools:


(MMU): insert radius of toroidal tools
The R parameter contains the tool radius, while the MMU parameter the insert radius:
MMU=0, cylindrical tool
MMU<R, toroidal tool
MMU=R, spherical tool

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

7.3.7 G802K7: LINEAR EYELET

Eyelet geometry:
- Eyelet center coordinates
- Angle rotation of the eyelet (MMG parameter)
- Eyelet length (MML parameter)
- Eyelet width (MMD parameter)

The eyelet machining considers a roughing and a finishing machining.


The MMV parameter defines the type of machining desired:
MMV = 0, executes roughing and finishing of the eyelet with the same tool
MMV = 1: roughing only
MMV = 2: finishing only

Roughing with MMW = 0 (sinking in a pre-hole)


1. Rapid positioning on the plane on A or B point, depending on the sign of MML.
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to the computed depth (pass depth = MMK) with feed equal to MMF.
4. Reaching of the opposite point (B or A) with F feed
5. Exit to safety position (MMA+MME) with feed MMF
6. Rapid repositioning on A (or B)
7. Descent to the computed depth with MMF feed
8. Eyelet contouring with final return on point A (or B)
9. Repetition of steps 3, 4, 5, 6, 7, 8 up to the end eyelet position MMB.

Roughing with MMW > 0 (sinking with ramp)


1. Rapid positioning on the plane on A or B point, depending on the sign of MML.
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to MMA position with MMF feed
4. Oscillation between A and B points (or viceversa) until the computed pass depth is
reached after MMW oscillations. The oscillation depth is the pass depth MMK, divided by
the number of oscillations MMW. In the displacement between points A and B (or
viceversa), the Z axis sinks with the oscillation depth, while the return happens with
constant Z position.
5. Eyelet contouring with final return on point A (or B)
6. Repetition of steps 4,5 until the eyelet end position MMB is reached

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

List of parameters for linear eyelet:

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

Optional parameters for rotation:


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

Optional parameters for machining allowance:


(MMS): allowance at roughing end.

Optional parameters for sinking:


(MMW): sinking mode
MMW = 0: sinking in a pre-hole centered in A or B, depending on the MML sign:
MMW > 0: sloped sinking with MMW oscillations between point A and point B
(MMF): sinking feed

Optional parameters for movement direction:


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

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

7.3.8 G802K8: CIRCULAR EYELET - EYELET CENTER

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)

The eyelet machining considers a roughing and a finishing machining.


The MMV parameter defines the type of machining desired:
MMV = 0, executes roughing and finishing of the eyelet with the same tool
MMV = 1: roughing only
MMV = 2: finishing only

Roughing with MMW = 0 (sinking in a pre-hole)


1. Rapid positioning on the plane on A or B point, depending on the sign of MML.
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to the computed depth (pass depth = MMK) with feed equal to MMF.
4. Reaching of the opposite point (B or A) in circular interpolation, with F feed
5. Exit to safety position (MMA+MME) with feed MMF
6. Rapid repositioning on A (or B)
7. Descent to the computed depth with MMF feed
8. Eyelet contouring with final return on point A (or B)
9. Repetition of steps 3, 4, 5, 6, 7, 8 up to the end eyelet position MMB.
At the end of the roughing cycle, the finishing cycle is executed if MMV = 0.

Roughing with MMW > 0 (sinking with ramp)


1. Rapid positioning on the plane on A or B point, depending on the sign of MML.
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to MMA position with MMF feed
4. Oscillation between A and B points (or viceversa) until the computed pass depth is
reached after MMW oscillations. The oscillation depth is the pass depth MMK, divided by
the number of oscillations MMW. In the displacement between points A and B (or
viceversa), the Z axis sinks with the oscillation depth, while the return happens with
constant Z position.
5. Eyelet contouring with final return on point A (or B)
6. Repetition of steps 4,5 until the eyelet end position MMB is reached
At the end of the roughing cycle, the finishing cycle is executed if MMV = 0.

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

List of parameter for circular eyelet, with known eyelet center

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

Optional parameters for rotation:


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

Optional parameters for machining allowance:


(MMS): allowance at roughing end.

Optional parameters for sinking:


(MMW): sinking mode
MMW = 0: sinking in a pre-hole centered in A or B, depending on the MML sign:
MMW > 0: sloped sinking with MMW oscillations between point A and point B
(MMF): sinking feed

Optional parameters for movement direction:


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

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

7.3.9 G802K9: CIRCULAR EYELET - CURVATURE CENTER

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)

The eyelet machining considers a roughing and a finishing machining.


The MMV parameter defines the type of machining desired:
MMV = 0, executes roughing and finishing of the eyelet with the same tool
MMV = 1: roughing only
MMV = 2: finishing only

Roughing with MMW = 0 (sinking in a pre-hole)


1. Rapid positioning on the plane on A or B point, depending on the sign of MML.
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to the computed depth (pass depth = MMK) with feed equal to MMF.
4. Reaching of the opposite point (B or A) in circular interpolation, with F feed
5. Exit to safety position (MMA+MME) with feed MMF
6. Rapid repositioning on A (or B)
7. Descent to the computed depth with MMF feed
8. Eyelet contouring with final return on point A (or B)
9. Repetition of steps 3, 4, 5, 6, 7, 8 up to the end eyelet position MMB.
At the end of the roughing cycle, the finishing cycle is executed if MMV = 0.

Roughing with MMW > 0 (sinking with ramp)


1. Rapid positioning on the plane on A or B point, depending on the sign of MML.
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to MMA position with MMF feed
4. Oscillation between A and B points (or viceversa) until the computed pass depth is
reached after MMW oscillations. The oscillation depth is the pass depth MMK, divided by
the number of oscillations MMW. In the displacement between points A and B (or
viceversa), the Z axis sinks with the oscillation depth, while the return happens with
constant Z position.
5. Eyelet contouring with final return on point A (or B)
6. Repetition of steps 4,5 until the eyelet end position MMB is reached
At the end of the roughing cycle, the finishing cycle is executed if MMV = 0.

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

List of parameter for circular eyelet, with known curvature center

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

Optional parameters for rotation:


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

Optional parameters for machining allowance:


(MMS): allowance at roughing end.

Optional parameters for sinking:


(MMW): sinking mode
MMW = 0: sinking in a pre-hole centered in A or B, depending on the MML sign:
MMW > 0: sloped sinking with MMW oscillations between point A and point B
(MMF): sinking feed

Optional parameters for movement direction:


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

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.

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
Optional parameters for thread direction: MMA
(MMJ): thread direction
MMJ = 0 : right thread
MMJ = 1 : left thread MMP

MMQ

MMB

D. ELECTRON 265
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

7.3.11 G802K11: HOLE THREAD MILLING WITH A COMB END MILL

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.

Optional parameters for safety distance:


(MME): safety distance on thread top and bottom. The approach (and retraction) to the
thread is executed in a fourth of thread; the MME diameter indicates the starting diameter
initiating the fourth of thread approach to the machining. For example, if the internal
diameter is 50, tool radius is 10 and MME is 2, the approach point is at coordinates X0 Y37.
If MME=0 a default safety distance of 2mm is assumed.

Optional parameters for polishing passes:


(MMN): number of polishing passes.

Optional parameters for last roughing pass:


(MMW): last roughing pass depth. If MMW=0, all roughing passes have the same pass
increment, less than or equal to MMK. If MMW>0, the last roughing pass has a MMW
depth.

Optional parameters for thread direction: MMD


(MMJ): thread direction MMA
MMJ = 0 : right thread
MMJ = 1 : left thread
MMP

MMQ

MMB

D. ELECTRON 267
CNC Z32 Programming Manual Chapter 7 - Z32 Fixed cycles and macros

7.3.13 G802K13: STUD THREAD MILLING WITH A COMB END MILL


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

MMQ

MMB

268
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

7.3.14 G802K14: FACE MILLING

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

Optional parameters for pass overlapping:


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

Optional parameters for sinking feed:


(MMF): sinking feed If not programmed, or if equal to 0, the sinking feed assumes the F
value.

Optional parameters for pass increment:


(MMV): type of pass increment
MMV = 0 : the pass increment is executed in G1 on the internal side of working rectangle
MMV = 1 : the pass increment is executed in G0 on the external side of working rectangle of
2mm.

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:

Usage of G801K7 positioning macro with G800K1 fixed cycle


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

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

(Program P40 defines the figure to be moved on circle points)


--DEFINE P40
G0X0Y0
Z2
G1Z0
Z-1
G1X10
Y5
X-10
Y-5
X10
Y0
G0X0Y0
Z2G0
G26
--END DEFINE

(definition of positioning to be skipped)


PAR[1]3
(MPX=10, MPY=20: the positioning circle is centered in 10,20)
(MPC=100: the positioning circle has diameter 100)
(MPA=0, MPL=0, MPN=8: execute 8 positioning on all the circumference)
(MPS=1: skips positioning defined in PAR[1])
(MPF=40: positions program 40)
(positioning macro recall)
G801K7 MPX10 MPY20 MPC100 MPA0 MPL0 MPN8 MPS1 MPF40
G0 Z50
G0 Z50
M2

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

272
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Fixed cycles and macros

Example 4:

Usage of the G802K1 machining macro (circular pocket roughing):

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

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)

G802 MMA0 MMB-10 MMC10 MMD30


G802K1 HX1 MMK3 MME2 MMW1 MMQ4
(positioning macro recall)
(MPX=10, MPY=20:)
(the positioning circle is centered in 10,20)
(MPC=60: the positioning circle has diameter 60)
(MPA=0, MPL=0, MPN=8:)
(executes 8 positioning around all circumference)
(MPS=1: skips positioning defined in PAR[1])
(MPW=1:)
(circular motion between positioning)

(definition of positioning to be skipped)


PAR[1]3

G801K7 MPX10 MPY20 MPC60 MPA0 MPL0 MPN8 MPS1 MPW1


G27C0 (fixed cycle deactivation)
G0 Z50
M2

274
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs

CHAPTER 8

8. MACHINE TOOL BUILDER AND USER CANNED CYCLES


AND PERMANENT SUB-PROGRAMS

8.1 CANNED CYCLES


This chapter discusses non standard macros and canned cycles, implemented by the machine
tool builder, or directly by the end user.
The canned cycles of Z32 are realized through sub-programs that can be modified to suit the
needs of the machine tool controlled by Z32.
We have seen in the chapter on Preparatory G Functions that the canned cycles are activated
by programming:
G27C...
A number that specifies the canned cycle to be activated must follow the letter C.
The letter C after G27 is not a parameter; any C parameter programmed previously is not
modified and the canned cycle number cannot be read in parameter C.
Two types of canned cycles are possible:
SYSTEM canned cycles (from 1 to 30)
USER canned cycles (from 31 to 109)
System The system canned cycles are inserted in a protected part of the permanent memory of Z32 and
canned are programmed by the manufacturer of the machine tool and must not be modified by the end
cycles user. When the activated canned cycle number is between 1 and 30 the Z32 automatically looks for
a system canned cycle (resident in CMOS memory, programs from 170 to 199).
During execution of a system canned cycle the progressive number is stopped (i.e. a block
search procedure cannot be performed inside a system canned cycle) and the executed program
lines are not displayed (unless the CNC is put on service mode with special procedure).

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

Canned cycles are disabled by programming:


G27C0 zero canned cycle
G27X
Stop By programming G27X the active canned cycle is suspended. G27X is valid only in the block
canned where it is programmed.
cycle The jump to a canned cycle consumes one jump/return nesting level. See the chapter on
Evolute Lines, paragraph Jumps (GON-N).
In the following paragraphs there are a few examples of canned cycles and a few examples of
usage: in compiling canned cycle sub-programs only parameters: AA AB and AC have been used
instead of X, Y, X to program axes movement. This permits the use of standard canned cycles,
regardless of is WORK PLAN and the AXIS on which the canned cycles are taking place.
As the machine tool manufacturer introduces the canned cycles directly in Z32, it is necessary
that the final user refer to instructions given by the said manufacturer. The following canned cycles
are only didactic examples.
Examples If the programmer wants to create his own special canned cycles, he must clearly specify the
of canned meaning of parameters used, and must be careful not to use system parameter or parameters to
cycles which another meanings have been assigned in the machine organisation.
In the main program, before starting canned cycle, the desired values should be given to the
various parameters used so the canned cycle can been performed correctly.
The parameter values of canned cycle may be changed after activating a canned cycle: for
example in the drilling canned cycle referred to in the following paragraph, the first 10 holes may be
made with HC=HA. However, before the eleventh hole a higher HC can be declared in order to get
over an obstacle between 10 and 11.
Canned cycles may be called from inside a sub-program, during repeated execution of lines, etc.

8.1.1 Example of Drill


G27C1.... .Composition:
1. input traverse to the hole start
2. feed to the hole end
3. traverse return to the exit level
Parameters:
HA hole start position
HB hole end position
HC exit position
Program 170:
CANNED DRILLING CYCLE%
N1 G0 AC<HA> third axis traverses to hole start
N2 G1 AC<HB> working movement to hole end
N3 G0 AC<HC> G26 traverse return at end of sub-program
Please note the initial % (necessary), after the description (unnecessary)

8.1.2 Example of Drill with Dwell


G27C2.... . Composition:
1. traverse movement to hole start

276
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs

2. working movement to hole end


3. dwell
4. traverse return to exit position
Parameters:
HA hole start position
HB hole end position
HC exit position
TT dwell time
Program 171:
DRILLING WITH DWELL %
N1 GO AC<HA> traverse movement to hole start
N2 G1 AC<HB>G4 working movement to hole end and dwell TT seconds
N3 G0 AC<HC>G26 exist on traverse and end

8.1.3 Example of Deep hole


G27C3.... .Deep drilling cycle with constant increment
Composition:
1. traverse movement to hole start
2. working for a length equal tool diameter
3. traverse removal to hole start
4. traverse movement to the drilled level
5. working repetition to hole end
6. traverse return to exit position
Parameters:
HA hole start position
HB hole end position
HC exit position
R tool radius
HE internal parameter
Program 172:
DEEP DRILLING%
N1 HE<HA> puts HE at
hole start
N2 G0 AC<HE> traverse to start of hole to be made
N3 1HE=HE-2*R! HE increases to twice the radius
N4 1IFHE<=HB;HE=HB! limits to hole end
N5 G1 AC<HE> hole up to HE
N6 G0 AC<HA> rapid release up to hole start
N7 !IFHE>HB;GON2! repeats if hole not finished
N8 G0 AC<HC> HE0 G26 traverse to exit

8.1.4 Example of Tapping


G27C4.... .Composition:

D. ELECTRON 277
Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual

1. traverse movement to hole start


2. working to hole end
3. spindle stop and dwell time
4. spindle reversal and return to hole start
5. traverse to exit position
6. restore direction of spindle rotation
Parameters:
HA hole start position
HB hole end position
HC exit position
TT dwell time
Program 173:
TAPPING%
N1 G0 AC<HA> M3
N2 G1 G84 AC<HB> M5
N3 G4
N4 AC<HA> M4
N5 G0 G80 AC<HC>
N6 M3 G26

8.1.5 Example of Boring with working reversal


G27C5.... .Composition:
1) traverse movement to hole start
2) working to hole end
3) working return to hole start
4) traverse to exit position
Parameters:
HA hole start position
HB hole end position
HC exit position
Program 174:
BORING WORKING RETURN%
N1 G0 AC<HA>
N2 G1 AC<HB>
N3 AC<HA>
N4 G0 AC<HC>G26

8.1.6 Example of Boring with spindle stop


G27C6.... . Composition:
1) traverse movement to hole start
2) working to hole end
3) spindle stop and dwell time
4) working return to exit position
5) traverse to exit position

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

8.1.7 Example of Boring with indexed spindle reversal


G27C7.... .Composition:
1) traverse movement to hole start
2) working to hole end
3) spindle indexing
4) tool shift of 0,1 mm.
5) traverse to exit position
6) spindle running
Parameters:
HA hole start position
HB hole end position
HC exit position
Program 176:
BORING WITH INDEXED SPINDLE REVERSAL%
N1 G0 AC<HA>
N2 G1 AC<HB> M19
N3 G0 AA<AA-0,1>
N4 AC<HC>
N5 M3 G26

8.1.8 Example of Internal milling


G27C8.... .Composition:
1) working movement to working position
2) circular milling with return at the centre
3) traverse to exit position
Parameters:
HA working position
HC exit position
HD drill gauge
R tool radius
Program 177:

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

8.2 PERMANENT SUB-PROGRAMS


In the previous paragraph we have seen the Z32 permits the execution of canned cycles with an
automatic jump to active canned cycle after every G0 positioning
G27P....
In a similar way it is possible to do an automatic jump to an active sub-program (which we shall
call permanent) without the need to perform positioning in G0.
To activate the permanent sub-program (see chapter on Preparatory G Functions) program
G27P... , where the letter P is followed by the identification number of the activated sub-program.
The P behind G27 is not a parameter, i.e. any P parameter previously programmed is not
modified and the number of the active permanent sub-program cannot be read in parameter P.
G27P0
disconnects permanent sub-programs. When turned on and after reset G27P0 is active.

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.

8.2.1 Example 1 - Toothed line with two tooth types


We want to make a tooth profile in XY. There are two tooth types (one with plane bottom and
one with triangular bottom). The tooth pitch is not constant.
PRINCIPAL PROGRAM%
N0 X0 Y0 Z0 OX1 OY1 OZ1

D. ELECTRON 281
Chapter 8 - Machine tool builder and User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual

N1 T10 M6 (milling cutter radius 5)


N2 F500 S2000 M3
N3 G41 X20 Y0 QF0
N4 G1 G27P20 KG1 X50 (TOOTH TYPE 1)
N5 X85 Y5 (HERE TOOTH NOT EXECUTED BECAUSE NO KG)
N6 KG2 X100 Y0 (TOOTH TYPE 2)
N7 KG1 X130 (TOOTH TYPE 1)
N8 KG2 X170 (TOOTH TYPE 2)
N9 X200
N10 G40
N11 G27P0 M2

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).

8.2.2 Example 2 - Program in XY for polar coordinates machine


We have a machine with two axes: X (linear axis in mm.) and B (rotating axis in degrees). We
want to program the profile to be executed by programming the XY movements in mm, as for a
machine with rectangular coordinates.
Note that this program is only to give a demonstration of HOW a KG can be used, it is NOT a
complete solution of the problem. In the case of the example we would:
test the program on a real machine
manage circular lines or even better manage a more complete geometry (for example
using KG=1 for segments, KG=2 for clockwise circle, KG=3 for counter-clockwise circle
etc.)
control the effect on the machine of B passing from -180 to +180 degrees and if
necessary avoid this passage
manage the radius compensation

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

NORMAL X<<X*0.6>> Y<<Y+0.03*X*X>>

Y<<Y*0.6>> X<<X+0.3*Y>> Y<<Y*0.6>>

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.

9.1.1 Permanent formulae content


A permanent formula consists of a mathematical expression enclosed in double acute brackets
containing:
four mathematical operators:

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

9.1.2 ISO line syntax with permanent formulae


The permanent formulae must be inserted in an ISO line.
Several permanent formulae (relating to different axes) may be introduced on one ISO line.
For example:
N100 X<<X*0,95>> Y<<Y*0,965>> Z<<0,126/1000*X>>
If, by error, several permanent formulae are defined in one ISO line on the same axis the Z32
does not give an alarm: the last programmed permanent formula remains active.
Other instructions may be inserted in the ISO line that contains the permanent formulae, which
are executed normally: if however the axes movements are inserted before the formula they are not
executed, if they appear after the formula they are executed (see following paragraph)
Formulae may be added to the next ISO line (initial ! character, see next paragraph).

9.1.3 Enabling Disabling Variation of permanent formulae


Permanent formulae are enabled when there is a change from a normal axes situation to a
situation of formulae operating. Disabling occurs when a change from a situation of formulae
operating to a normal situation. The variation is changing directly from one set permanent formulae
to another, without passing through the normal situation.
We have seen that several permanent formulae can be activated on each continuous axis of the
machine: with active formulae there is in the CNC memory a set of formulae, associated to each
axis. With inactive formulae the set is null.
The set of the permanent formulae is indivisible, that is, it is not possible to change only one of
the formulae (the formula related to a single axis). An ISO line containing only one permanent
formula causes the cancellation of the entire set of formulae and it has to be recompiled from the
beginning.
X<<!...>> If instead the new formula contains an initial ! it is added to the previous formulae.

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.

9.1.4 Initial and final connections


We have seen that the activation of a permanent formula implies a machine point change (that
is the point where Z32 keeps the machine axes) from the old point to the new point calculated by
applying the formula. For example:
...
N1 X0 Y100 Z0
N2 X<<X*0,9>> Y<<Y*0,8>>
...
Before N2 instruction, the machine points are 0 for X axis and +100 for Y axis; after formulae
activation the new points are 0 for X and +90 for Y: i.e. there is a 10 mm discontinuity on the Y.
Z32 introduces a rectilinear connection segment, parallel to the programmed axis, for each
permanent formula introduced, to recuperate without alarms any discontinuity introduced by
permanent formulae.
The starting point of the connection movement is the axis position before the formula activation
and the arrival point is the position calculated with the formula operating.
The connection is executed as rectilinear segment working at F speed which is active at the
moment.
If several formulae related to different axes are introduced, a connection is inserted for every
formula introduced.
Permanent formula programming represents an EXCEPTION in Z32 behaviour, which executes
the relative connection IMMEDIATELY during the analysis phase and does not wait for the next
execution phase (see at cap. 4: AN ISO LINE EXECUTION SEQUENCE). The same axis motions
programmed in the same line, but before the formula, are not executed but are incorporated into the
connection.

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

N20 !X=50! no axes movement, only parameter X is up-dated to


value 50
N30 X<<X*0.8>> a connection in X from 100 to formula result (X=X*0.8)
applied to programmed value (50) that is to 40
...

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.

9.1.5 Permanent formulae compilation


We have seen that permanent formulae must be executed 500 times per second. To reduce as
possible the microprocessor load formulae are examined, reduced to lowest terms and traslated

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>>

9.1.6 Execution time


We have seen earlier than permanent formulae are executed by Z32 500 times per second: it is
therefore necessary that Z32 keeps a strict control of the programmed formulae, to avoid
overloading the microprocessor.
8000 machine cycles is the maximum time than the microprocessor can give to permanent
formulae execution. This corresponds to about 12% of the total CPU time available.
The preventive calculation of the permanent formula execution times is not easy: it is necessary
to take into consideration some simplifications and precomputations that Z32 makes during
compilation. We give the approximate times of the important operations to have an idea of
execution times. The times are expressed in machine cycles: the total time of all the formulae
introduced must not exceed 8000.
Addition 270
Subtraction 270
Multiplication 620
Division 920
Unknown programming 170
Fixed time for each formula 160
Some compilation rules:
1) several constants multiplied together are reduced to a single multiple constant
2) the parameters and PI are constant during the compilation
3) if only constants are inside a bracket the whole bracket is to be considered a constant.
Examples:
X<<HA>> 1 form = 160
X<<X*0.957>> 1 form,1 axis,1 mult. =160+170+620=950
X<<X>> 1 form,1 axis=160+170=330
X<<X*0.9+0.1>> 1 form,1 axis,1 mult, 1 add=160+170+620+270=1220
X<<X*0.9>Y<Y*0.8>> 2 form,2 axes,2 mult=320+340+1240=1900

D. ELECTRON 291
Chapter 9 - Permanent Formulae CNC Z32 Programming Manual

X<<X*(HA+0.1*(HB+0.5))*0.05>> 1 form,1 axis,1 mult=160+170+620=950


X<<X-0.1*X>> 1 form,2 axes,1 mult,1 sub=160+340+620+270=1390
X<<X*0.9+Y*(HA+HB+0.1)/3>> 1 form,2 axes,2 mult,1 add=160+340+1240+270=2010

9.1.7 End of travel control


The Z32 end of travel (consisting of preventive control that programmed movements do not
overstep the limits) are not efficient when permanent formulae are operating.
When permanent formulae are active the end of travel control is performed in real time, i.e.
movement must be produced for the end of travel to intervene.
The end of travel with formulae operating do not work in block search procedure (that is, the
program may run in block search procedure and then give end of travel error message during the
execution).
The end of travel calculation with formulae operating takes into consideration the approach
speed to end of travel, the distance from the end of travel and the calibration accelerations on every
axis: there is alarm if the approach speed exceeds that which permits the braking within the end of
travel.
The end of travel warning with formulae operating is an alarm type:
CNE.13
where the logic axis number is inserted instead of the dot. For example CNE113 means end of
travel error with formulae operating on the axis with logic number 1 (normally axis Y).

9.1.8 Maximum feed control


The movement feedrate with formulae operating may be different (more or less) from the
programmed feedrate. For example, if X <X*2> formula is enabled, the movements in X axis have
double feedrate (and acceleration!) with respect to the programmed feedrate.
To protect the machine, in the present of active formulae, the Z32 gives a warning if the feedrate
on any of the axes exceed the maximum feedrate by 2%. The relevant alarm is:
CNF.13
where normally the logic number of the axis on which the overspeed is detected is inserted
instead of the dot. e.g. CNF213 means overspeed alarm with active formulae on the axis with logic
number 2 (normally axis Z).
With G108 (see chapter on Preparatory G Functions) it is possible to set the maximum
interpolation feedrate limit (G108 acts before the permanent formulae) and thereby avoid exceeding
the maximum feedrates tolerated by the tool machine.
x<<*>>
Programming <<*>> formula than multiplies the axis dimension by the constant contained in HX
parameter it is an effective way to manage feedrate and acceleration.
For example:
HX2 X<<*>>
multiplies X axis values by factor 2. The same performance may be obtained with the formula:
X<<X*2>>
However, there is a considerable difference in feedrate and acceleration management.
The programmed movement is interpolated by the CNC on the original path and it is then
amplified according to the multiplication factor formulated.
The feedrate and accelerations limitations to prevent exceeding the set maximum feedrate and
acceleration are made on the original path.

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.9 Active Formulae and G53


G53 or G54 programming is not admitted with active permanent formulae. If this is done, CNC
gives message and alarm:
CN3914 <<FORMULA + G53/54>>
The tool change (M6) and other special Ms often require machine movements referred to the
base origin and therefore require execution of G53 or G54 in the sub-program which is
automatically called. In these cases the permanent formulae must be DISACTIVATED BEFORE M
programming.

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.

Engravings on an inclined plane


Some engravings must be done on an inclined plane. It is acceptable that the working plane not
be horizontal and axis Z be vertical (X and Y are the horizontal axes).
The generic equation of a plane is:
Z = C1 + C2 * X + C3 * Y
If the following formula is introduced:

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.

Engravings on a cylinder (orthogonal axes)


We have a machine in the position shown in the figure and we must make engravings on the
bottom of the half cylinder with RB radius set horizontal and parallel to the axis Y. The origins are in
the cylinder centre.
The exact equation of Z movements requires a square root:
As the square root is missing, this equation may be approximated with a series:
Z= RB*[0.5*(X/RB)2+1/8*(X/RB)4+1/16*(X/RB) 6+....]
In first approximation, the formula to be programmed may only contain the first term:
Z<<Z+X*X/2/RB>>
In this case the error is approximately: =RB/8*(X/RB)4
i.e., if RA=50, for X=10 the error is about 0.01 mm, for X=20 the error is about 0.16mm.

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.

GEOMETRY and lathes


In this chapter all examples are related to milling machines.
On systems for lathes, the profile programming follows the same rules valid for milling
machines, with the following exceptions:
- the working plane of a lathe is always the ZX plane
- the X axis and the J parameter are normally programmed as diameter values

10.2 GEOMETRIC CONTOURS IN THE PLANE


A geometric contour may be formed by the following elements:
points
line segments
circle arcs
linear chamfers
circular connections
The lines and the circles are considered contour segments and may be open or closed; the
chamfers may appear at the end of the programmed segment.
The Z32 manages the contour execution feedrate with particular algorithms which are examined
in more depth in the paragraph Feedrate Management.

10.2.1 Geometric definitions


At this point it is important to introduce some definitions in order to interpret the text correctly and
to define the meaning of specified terminology used.
Defined A defined point is any point of the plane programmed or calculated by Z32. A defined point may
point be the initial point or the end point of a segment.
A segment is a line segment or a circle arc and it may be open or closed.
Profile A straight segment and a circle are said to be closed when they end in a defined point, and are
segment open when the end point is not defined, but must be calculated with the information related to next
segment.

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.

10.2.2 Elements defining a contour


Geometric parameters (positions, radius, inclinations, etc) and preliminary functions fixing the
segment type (G1, G2, G3) are the elements that locate a segment of the contour.

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.

Centre coordinates and I, J, RA circle radius


The circle centre coordinates are programmed with I (first axis) and J (second axis) parameters.
The ISO standards associate rigidly I to X axes and J to Y axis, whereas for Z32 I is associated
with the first axis of the working plane and J to the second axis, regardless of the plane axes (X, Y,
Z or other).
ISO standard Z32
I <=> X I <=> AA (first axis)
J <=> Y J <=> AB (second axis)
K <=> Z K <=> it is not assigned (thread cutting step)
So for Z32 we have, for example:
with G25XYZ with G25XCZ
I <=> X I <=> X
J <=> Y J <=> C

The radius of the circle is programmed with RA


parameter.

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

It is programmed with QF parameter and it is expressed in sexagesimal degrees (1 turn=360


degrees) and by decimal fractions of degree (e.g. QF 10,5=10 degrees and 30').
QF is positive if, starting from X axis, the direction is reached moving counter-clockwise; the
same result is obtained by programming: QF 280 and QF -80

At the beginning of each contour, i.e. after:


segment in G0
auxiliary function
G1 with axes outside of plane
change work triad
the final inclination is forced to zero.

RR circular connection radius


At the end of each contour segment a circular connection can be programmed with RR
parameter which is inserted at the end of the block in which it is programmed.
RR sign determines the circular connection direction:
RR positive counter-clockwise circular connection (G3)
RR negative clockwise circular connection (G2)
A contour segment with end circular connection may be closed or open.
A circular connection radius cannot be programmed in a contour segment that is closed by the
next one keeping the inclination (continuous point).
If RR is programmed in a block where it is not allowed it will cause programming error message
CN4514 (RB/RR started on circle). See paragraph on Automatic circular connection further on.

Short /Long circular connection


A circular connection with defined orientation may be chosen from the two which are possible
with KA selection parameter:
KA = 0 short circular connection, that more spontaneous (may be omitted);
KA <>0 long circular connection.
See the following page.

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=

KA= KA=1 KA=1

A special case of KA is the closing of an open line on a circle G2/G3X Y RA.


In this case KA=0 means short circle arc and KA<>0 means long circle arc (see paragraph
Closed Circles).

RR programmed RR not programmed


KA=0 Short connection Turns left
KA<>0 Long connection Turns right

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.

10.2.3 Ways of Programming of contour segments


G1, G2, G3 preparatory functions prepare the Z32 to execute rectilinear, circular clockwise and
circular counter-clockwise contour segments. To define the contour segment to be executed it is
necessary to give to Z32 the numerical data relating to the contour geometry.
The profile must be fully defined by the part-program in order to be executed by Z32. Each
contour segment must therefore have an adequate number of parameters for its definition.
There are many combinations of information to define a contour segment geometrically. To
define a rectilinear segment from a defined point we could give for example:
two coordinates of the end point
one final coordinate imposing axially parallel motion
the inclination and the length
the length and one intermediate point
...
There are innumerable possibilities but some are of little use. It has been necessary to make a
X selection, limiting the number of possible combinations.
first axis
For brevity and clarity, we shall use the name X to indicate the first axis of the plane and Y to
Y
indicate the second axis: we shall assume that the active triad is G25XY.... If the triad should be
second axis
different, substitute for X and Y the names of the first and the second axis of the plane respectively.
Z, X, I, J, QF, RA, QA, RR and RB together with preparatory G functions are the entities accept
Admissible
by Z32 to determine the contour segments. Different combinations of the parameters specified
entities
previously give rise to different ways of contour segment programming.
The Z32 manages and recognizes the parameter combinations and G in Table VIII-1.

D. ELECTRON 299
Chapter 10 - Geometry CNC Z32 Programming Manual

PLANE GEOMETRY COMBINATIONS Tab. VIII-1


____________________________________________________________
| | Previous | Present |
| Programmed | block | block |
| parameters |_______________________|___________|
| | DP| OL| OC|RR |RB |KA |RR |RB |KA |
|________________________|___|___|___|___|___|___|___|___|___|
|(G1) X XY | X | | | X | X | | X | X | |
| | | | Xc| | | | X | X | |
|________________________|___|___|___|___|___|___|__ _|___|
|(G1) Y | X | | | X | X | | X | X | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G1) X | X | | | X | X | | X | X | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G1) X Y QF | | X | | X | X | | X | X | |
| | | | Xc| X | X | X | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G1) X QF | X | | | X | X | | X | X | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G1) Y QF | X | | | X | X | | X | X | |
|________________________|___|___|___|___|___|___|___|___|___|
|G1 | Xc| | | | X | | X | X | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G1) QF | X | | | X | X | | X | X | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G2/G3) X Y I J | X | | | X | | | X | | |
| | | X | | X | | X | X | | |
| | | | X | X | | X | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|([G2/G3]) X Y | Xc| | | | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G2/G3) X Y RA | X | | | X | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|([G2/G3]) X Y RA | | Xc| | | | X | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G2/G3) I J RA | | X | | X | | X | X | | |
| | | | X | X | | X | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G2/G3) I J RA QF | | X | | X | | X | X | | |
| | | | X | X | | X | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G2/G3) I J | X | | | X | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|([G2/G3]) I J | | Xc| | | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G2/G3) I J QF | X | | | X | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|([G2/G3]) I J QF | | Xc| | | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G2/G3) I J QA | X | | | X | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|([G2/G3]) I J QA | | Xc| | | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G2/G3) RA | Xc| | | | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|(G2/G3) RA QF | Xc| | | | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|G1 G2/G3 I J X Y | X | | | X | X | | X | | |
| | | | Xc| | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|G1 G2/G3 I J RA | X | | | X | X | | X | | X |
| | | | Xc| | | | X | | X |
|________________________|___|___|___|___|___|___|___|___|___|
|G1 G2/G3 I J RA QF | X | | | X | X | | X | | |
| | | | Xc| | | | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|G1 G2/G3 I J X Y QA | | X | | X | | | X | | |
| | | | X | X | | X | X | | |
|________________________|___|___|___|___|___|___|___|___|___|
|G1 G2/G3 I J RA QA | | X | | X | X | | X | | X |
| | | | X | X | | X | X | | X |
|________________________|___|___|___|___|___|___|___|___|___|
|G1 G2/G3 I J RA QA QF | | X | | X | X | | X | | |
| | | | X | X | | X | X | | |
|________________________|___|___|___|___|___|___|___|___|___|

DP = Defined point OL = Open line OC = Open circle


X => Admitted combination
XC => Admitted combination with continuous point: tangency condition
() => May not be programmable if already active
G2/G3 => One of the two can be programmed
[G2/G3] => G2 or G3 is forced by Z32 only in current segment

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.

10.2.4 Closed lines


Closed straight segments may be defined with the coordinates of end point and its inclination in
the following ways:
(G1) X Y inclined line -1-
(G1) X line parallel to first axis -2-
(G1) Y line parallel to second axis -3-
(G1) X QF inclined line with known end coordinate and inclination -4-
(G1) Y QF inclined line with known end coordinate and inclination -5-
(G1) X Y QF inclined line with known end coordinates and inclination -6-

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 X.. QF..-G1 Y.. QF..


Lines 2, 3, 4, 5 must come from a definite point. If the previous segment is open the error
message CN3414 previous block open will appear.
....
G0 X0 Y0
G1 Y10
X-10 QF120
X-20 QF165
X-30 QF180
....

G1 X.. Y.. QF..


Line 6 calculates the end point intersecting the previous segment which must be an open circle
or an open line.
For the line 6 KA selection parameter in the previous open circle must be defined.
All lines may have the connections and the chamfers at the end of the segment, unless there are
continuous points.
All lines may be preceded by a chamfer or by a connection programmed in the previous
segment, unless there is a continuous point.

.....
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.

10.2.5 Open lines


Open lines are defined only as direction and they must come from defined point.
The Z32 calculates the point of intersection with next segment: if this is a line, KA is ineffectual, if
it is a circle, KA must be programmed if different from zero.
The programmable forms are two:
G1 (KA) continuation line -7-
(G1) QF (KA) line with programmed inclination -8-
If the previous segment is open the error message CN3414 will appear (previous block open).
Line 7, being tangent to the previous segment, comes from a continuous point.

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
.....

10.2.6 Closed circles


Closed circle segments may be defined in different ways, using end point coordinates, the centre
circle, the radius and the inclination in end point.
(G2/G3) X Y I J end point coord. and circle centre -1-
(G2/G3) X Y RA end point coord. and radius -2-
(G2/G3) I J RA QF centre coord., radius and end inclination -3-
(G2/G3) I J QF centre coord. and end inclination -4-
(G2/G3) RA QF radius and inclination in end point -5-
(G2/G3) X Y end point coordinates -6-
(G2/G3) I J QA coordinates of the centre and length of arc in degrees -7-

G2/G3 X.. Y.. I.. J..


Circle 1 may come from defined point, from open line or from open circle. If the previous one is
an open segment in the previous step, the KA selection parameter must be specified.
If start point is defined and it is not in the current circle the Z32 gives alarm message CN3214
(previous block wrong).

D. ELECTRON 303
Chapter 10 - Geometry CNC Z32 Programming Manual

....
G0 X30 Y0
G3 I15 J0 KA1
I0 J15 Y30 X0
....

KA=1 => turns right

G2/G3 X.. Y.. RA..


Circle 2 may come from defined point or from open line; in this case the tangent condition is
imposed with the previous segment and the path is forced, only in the block, avoiding angular points
(KA does not act.)
.....
G0 X50 Y0
G1 Y5
G1 QF150
G2 X20 Y30 RA10 (KA0)
G1 X0
....

Circle 2, coming from a defined point has


another geometric particularity: two radius circle RA exist for two points (the initial one and the one
indicated): the Z32 chooses the shorter circle with KA=0, and the longer one with KA<>0.
The operation can be summarized as follows:
if the previous segment is open, the KA does not act (continuous line without possibility
of choice)
if the previous segment is closed, i.e. the circle arc starts from a defined point:
if KA is not programmed or is programmed to zero, the short arc is performed
(identical to previously, arc less than 180 degrees)
if KA is programmed with a value other than zero (e.g. KA1 must be
programmed on the same line as arc G2/G3 X Y RA) the long arc is performed
(greater than 180 degrees).
If the distance between the two points or between open line and specified point is more than
double the RA radius no connecting circle arc exists: the Z32 does not give an alarm message, but
it introduces a circle arc exactly equal to half the distance.
If the previous segment is an open circle the error message CN3414 will appear (previous block
open).

G2/G3 I.. J.. RA.. QF..


Circle 3 may come from an open segment containing KA selection parameter. QF is the angle
which the tangent to circle in end point forms with the axis of positive Z.
If the previous segment is closed the error message CN3214 will appear (previous block wrong).
If the intersection with the previous segment is not possible alarm message CN4414 appears
(missing intersection).

304
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry

G2/G3 I.. J.. QF..


Circle 4 may come from defined point or from open line; in this case the tangency condition is
imposed with the previous segment and the path is forced, only in the block, to avoid edges.
If the previous segment is an open circle the error message CN3214 will appear (previous block
wrong).

..... .....
..... 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
....

G2/G3 RA.. QF..


Circle 5 must come from defined point and this point keeps the inclination of the preceding
segment. For this reason it is a circle tangent to the previous segment.
If the previous tract is open the error message CN3414 will appear (previous block open).

....
G0 X0 Y20
G2 I10 J15 QF-60
G3 RA20 QF30
.....

G2/G3 X.. Y..


Circle 6 is an arc connected to the previous segment and it therefore comes from continuous
point.
The Z32 forces a clockwise or counter-clockwise path to avoid edges.
If the previous segment is open error massage CN3414 appears (previous block open).

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 X50 Y0 is forced in G3 but G2 remains active.

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

10.2.7 Open circles


Closed circle tracts may be defined in different ways, using end point coordinates, the centre
circle and the radius.
(G2/G3) I J RA circle and radius centre coordinates -8-
(G2/G3) I J circle centre coordinates-9-
(G2/G3)RA radius -10-

G2/G3 I.. J.. RA..


Circle 8 must come from an open segment and must have KA selection parameter. Also in the
current block KA selection parameter must be programmed.
If the previous segment is closed an error message CN3214 will appear (previous block wrong).
If intersection with previous tract is not possible the alarm message CN4414 will appear (missing
intersection).

....
G0 X0 Y50
G1 QF-90 KA1
G3 I-2 J10 RA30 KA1
G1 X-40 Y11 QF180
Y45
X0
.....

G2/G3 I.. J..


Circle 9 may come from defined point or from open line; in this case the tangency condition is
imposed with the previous segment and the path is forced, only in the step, to avoid edges.
Previous open segment must have KA selection parameter.
KA selection parameter must be programmed in the step.
If the previous segment is an open circle the error message CN3214 will appear (previous block
wrong).

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.

10.2.8 Line - circle combinations


This is a set of instructions which realize a movement in two segments: a line segment and a
circle which are at a tangent to each other.
The combination always defines a line followed by the circle and never the opposite.
G1 and G2 (or G3) programming is always necessary, and it must be done in this order (first G1
and then G2 or G3). Programmed G2 (or G3) remains operating after this segment. If G2 (or G3) is
programmed first and then G1, G1 remains operating and therefore Z32 will give alarm message
CN2C14 (incompatible parameters).
The allowed combinations are:
G1 G2/G3 I J X Y centre and end point on the circle -1-
G1 G2/G3 I J RA circle centre and radius -2-
G1 G2/G3 I J RA QF circle centre, radius and end inclination -3-
G1 G2/G3 I J X Y QA centre, end point and line inclination QA -4-
G1 G2/G3 I J RA QA centre, radius and QA inclination of the line -5-
G1 G2/G3 I J RA QF QA centre, radius, end incl. and QA inclination of the line -6-
The composite preparatory function is active only in the block.

308
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry

G1 G2/G3 I. J. X. Y. ..I. J. RA.. QF.. ...I J.. RA...


Combinations 1 2 and 3 may come from defined point or from open circle, in this case the
tangency condition is imposed and a continuous point comes: the line is tangent to the previous
circle.
If the previous segment is open line the error message CN3214 will appear (previous block
wrong).
If starting is from defined point and it is inside the circle the error message CN3314 will appear
(inside circle)

Example from defined point:


....
G1 X0 Y15
G1G2 I40 J20 X55 Y20
.....

From open circle:


.....
G1 X70 Y5
G2 I70 J22,5
G1G3 I40 J15 RA11
G1G2 I15 J30 X4 Y25
G1 X0
......

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.

G1 G2/G3 I.. J.. X.. Y.. QA..


The 4 combination must come from open line or open circle; the line inclined by QA intersects
these segment in two points and KA, present in the open segment, selects one or the other.
If the previous segment is closed the alarm message CN3214 will appear (previous block
wrong).
If intersection with the previous segment is not possible the alarm message CN4414 will appear
(missing intersection).

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.

10.2.9 Complete circle programming

Complete circle without G200 HX4


Complete circle programming is not possible: if end positions of programmed circle coincide with
start positions, the circle will not be executed.
Given the high precision of Z32 calculus it is possible to program a circle inferior to complete
circle even by a micron fraction.
For example:
...
N10 G0 X0 Y0
N11 G2 Y-0.001 X0 I50 J0
...
We obtain a practically complete circle with 50 radius.
A complete circle may be programmed also with two or more arcs: as the segments will be
connected, there will be no discontinuity.
For example:
...
N10 G0 X0 Y0
N11 G2 Y0 X100 I50 J0
N12 X0 Y0 I50 J0
...
In this case pay attention during radius compensation because the second circle arc intersects
first arc and therefore the whole circle is eliminated (see chapter on Radius Compensation).
Complete circle programming may demand at least three arcs during radius compensation.

Complete circle with G200 HX4


It is also possible to program a complete circle with instruction.

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

N3 G2 I40 J10 X25.23 Y10.759

At line N3 a complete circle is executed with centre I40 J10 and departure and arrival at point
X20Y10.

The conditions for the execution of a complete circle are

- to be programmed with G2/G3 I J X Y

- the final values must be identical to the initial values

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

10.3 CIRCULAR CONNECTIONS AND CHAMFERS


Z32 allows the inclusion of a chamfer between two defined lines and the inclusion of a circular
connection between two tracts, between two lines, between line and circle and between circle and
line.

10.3.1 Automatic chamfers


The chamfers are included at the end of the segment with RB parameter which represents the
length of the chamfer in the line where RB is programmed.
If only RB is programmed, a symmetrical chamfer is intended; by programming RB together QA
asymmetrical chamfers are executed in conformity with the following rule:
Length second side / RB = tangent of QA
Possible chamfer combinations are illustrated hereunder:

Closed line - closed line


G0 X0 Y0
G1 X20 Y20 RB10
(G1)X40 Y0
or
G1 X20 QF45 RB10
(G1) X40 QF-45

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

Closed line - open line / Open line - closed line

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

Closed line - line/circle


G0 X5 Y0
G1 Y20 RB10
G1G2 I30 J10 X30 Y0
or
G1G2 I30 J10 RA10 QF180

G0 X5 Y0
G1 Y20 RB10
G1G2 I30 J10 RA10
G1 X10 Y0

D. ELECTRON 313
Chapter 10 - Geometry CNC Z32 Programming Manual

Open line - line/circle

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.

10.3.2 Automatic circular connections


It must be observed that between one line and a circle, or between two circles which are not
oriented, there can be as many as 8 connections.
The Z32 selects the four congruent connections with the orientation of the segments.
The selection among the four connections is done using two discriminators:

Radius of RR connection with sign with already said meaning:


RR+ counter-clockwise connection (G3)
RR- clockwise connection (G2)

Parameter of KA selection with known meaning:


KA = 0 short connection
KA <> 0 long connection

314
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry

Closed line - Closed line

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

Closed line - Open line / Open line - Closed line

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

Closed line - Closed circle

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

Open line - Closed (open) circle

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

Closed circle - Closed line

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

Open Circle - Closed line

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

Open circle - Closed circle (external)


G0 X1 Y-10
G1 QF180
G2 I0 J0 RA10 RR-20 (KA0)
G2 I20 J0 X20 Y-5

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

10.3.3 Existence field of circular connections


It is important to make some considerations on the possibility of including a connection between
two tracts, if the two tracts are two lines, the problem will does not exist.
RA1 and RA2 the radius of two circles with RA2RA1
D the distance between the centres
|RR| the radius of connection without sign

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

10.4 PROGRAMMING EXAMPLES


Geometric contour programming is normally done in tool radius compensation: please refer to
the chapter on Radius Compensation.
All Z32 performances, rotation, traslation, mirroring, scale factor and tool radius compensation
can be used in the geometric contour programming.

10.4.1 Formed plate 1


FORMED PLATE%
OXA OYA OZA T9 M6
G0 X-10 Y-225 M3 M7 S1000 F1000
Z-10
G41 X0 Y-222
G1 QF 90
G3 I0 J-182,5 RA15 RR-5
G3 I0 J0 RA182 RR-5
G1G3 I47 J-179 RA16 QA-60 RR-5
G1 X59 Y<-113-42-11> QF90
X62 RR1
Y<-113-42,5+11>
X59
G1 QF90 RR-5
G1G3 I62 J-113 RA16 QA15 QF<180-15>
G1 QF<180-15>RR-5
G3 I0 J0 RA108 RR-5
G1G3 I104 J-42.5 RA16 QA0 RR-5
G3 I0 J0 RA108 RR-5
G3 I104 J42,5 RA16 QF180
G1 QF180 RR-5
G3 I0 J0 RA108 RR-5
G1G3 I42,5 J104 RA15 QA90 QF<270-30>
G1 RR-5
G3 I0 J0 RA108 QF180
G1 QF90
G3 I0 J<152,5-22,5 >RA10
G1G3 I0 J152,5 RA15
G1 X0 Y225 QF90
G40
G0Z100
M2

D. ELECTRON 325
Chapter 10 - Geometry CNC Z32 Programming Manual

326
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry

10.4.2 Formed Plate 2


FORMED PLATE%

OXA OYA OZA T9 M6 (CANDLE TYPE CUTTER)


G0 X10 Y225 M3 M7 S1000 F1000
Z-10
G41 X0 Y222
G1 QF-90
G3 I0 J152,5 RA15
G1G3 I0 J<152,5-22,5> RA10 QF0
G1 QF-90
G3 I0 J0 RA108 RR-5
G1G3 I-42,5 J104 RA15 QA120 QF-90
G1 RR-5
G3 I0 J0 RA108 RR-5
G1G3 I-104 J42,5 RA16 QA180 RR-5
G3 I0 J0 RA108 RR-5
G3 I-104 J-42,5 RA16 QF0
G1 QF0 RR-5
G3 I0 J0 RA108 RR-5
G1G3 I-62 J-113 RA16 QA<-180+15> QF-15
G1 QF-15 RR-5
G1 X-59 Y<-113-42+11> QF-90
X-62
Y<-113-42-11> RR-1
X-59
G1 QF-90 RR-5
G3 I-47 J-179 RA16 QF60
G1 QF60 RR-5
G3 I0 J0 RA182 RR-5
G3 I0 J-182,5 RA15 QA-70 QF0
G1 Y-225
G40
G0 Z100
M2

D. ELECTRON 327
Chapter 10 - Geometry CNC Z32 Programming Manual

328
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry

10.4.3 Propeller with three blades


PROPELLER WITH THREE BLADES %
OXA OYA OZA T9 M6 (CANDLE-TYPE CUTTER D8)
M3 S1000 F1000
G0 X5<-R> Y<5+R> (2ND QUADRANT)
Z-5
G41 X<4,5*CS150> Y<4,5*SN150>QF60
N1 G2 RA4,5 RR10
G1G2 I57 J46 RA68 QA110 RR-6
G2 I-57 J46 RA68 QF-110
G1 QF-110 RR10
G2 I0 J0 RA4,5 QF-60
N2
!QR=240;IR=0;JR=0;GON1-N2!
!QR=120;GON1-N2!
QR0
G40 X<5-R> Y<5+R>
G0 Z200 M2

D. ELECTRON 329
Chapter 10 - Geometry CNC Z32 Programming Manual

10.5 CONTOURS ON THREE AXES


The Z32 realizes linear and circular interpolations on three axes with the preparatory function
G12. A contour in space is formed by lines and helical arc segments.
The line segments are programmed with:
G1 X... Y... Z...
The helical arcs are programmed only with:
G2/G3 I... J... X... Y... Z...
where I and J are the co-ordinates of the base circle centre, while X.. Y.. and Z.. are the
coordinates of end point of movement.
The programming of a third axis on G2/G3 circle arcs is allowed without a previous programming
of G12. In addition, it is not necessary that the third programmed axis be the third axis of the
working triad.
The instruction can be used also in tool radius compensation.
See Chapter Tool Radius Compensation.

10.6 FEEDRATE CONTROL


The Z32 tries to keep the feedrate of the path as continuous as possible and equivalent to
programmed feedrate when executing programmed contour. However, in some situations feedrate
should be reduced to avoid errors.
Every contour segment is broken down to three parts, according to the feedrate:
an initial acceleration part to reach the central feedrate
a central part with constant feedrate
an final deceleration part to reach the end feedrate

10.6.1 Initial acceleration


This is a part with constant acceleration, on the programmed path, to reach the central feedrate
starting from the final feedrate of the previous segment.
This part may be missing if the central feedrate is the same as the end feedrate of the previous
segment.

10.6.2 Central constant feedrate


Depending on whether the block is working or rapid the central feedrate is:
programmed feed, possibly modified with override
the traverse feedrate, reduced to 1/5 plus override if there is the test-control active.
The effective central feedrate may be reduced in the following cases:
programmed feed causes a feedrate superior to traverse/1.2 on one or more axes
involved in the movement: the feedrate is reduced to (traverse/1,2). This prevents
exceeding top traverse feedrate with maximum override (120%)
the segment is circular with a small curvature radius, hence the resulting accelerations
are incompatible with those of machine settings: the feedrate is reduced to the
maximum compatible with the set accelerations.
the segment is circular in radius compensation with interior curvature: the feedrate is
reduced in the same proportion as the radius of curvature of the path of the tool centre

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.

10.6.3 End deceleration


This connects the central feedrate with the end feedrate of the segment.
The end feedrate is forced to zero (and so there is a final positioning) in the following cases:
the current movement or the next one is in G0
G12 is not operating and the next movement concerns one or more axes outside the
plane of work
An auxiliary function (S, T, M, MA, MB, MC) or a function with stop (G4, G25, G28, G29
etc.) is programmed at the end of the movement
For different cases there should be continuity of the feedrate and therefore the end feedrate is
maintained, as far as possible, equal to the constant central feedrate.
However in the following conditions we have a reduction of the end feedrate with respect to the
constant central feedrate:
the next movement (G1, G2 or G3) must be executed with a lower F: the end
feedrate is reduced to the start feedrate of the next movement. If the central feedrate of
the next movement is higher the end feedrate shall remain unchanged.
the segment and the circle arc have an end angle that could lead to a path error greater
than 0,005 considering the axes accelerations of the plane of work: the end feedrate is
reduced to the feedrate that gives an 0,005 error.
an activation or deactivation of motion in the third axis because of G12/G13 takes place
at the end of movement: the end feedrate is reduced to a minimum of circa 20 mm/min.
the length of the next segment is not sufficient to guarantee the stop of the axes
(bearing in mind the acceleration permitted by the axes involved): the end feedrate is
reduced to a feedrate that allows the stop of the axes at the end of the next segment.

10.6.4 Feedrate with G12 operating


We have seen how the end feedrate of the programmed segment can be reduced if there is
activation or disactivation of the third axis at end segment. When G12 is operating we have the
following procedure:
the central feedrate is constant and kept the same as that programmed on the path (if
the third axis is programmed the feedrate on the plane will be reduced, so the resulting
vectorial speed is equal to programmed feed)
any possible angles given from inclination changes in the third axis are not taken into
consideration: only if the third axis is activated or disactivated will the feedrate be
reduced in the corresponding start and end points. The operator must take care if
overshoots occur.

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

11. ROTATION, TRASLATION, MIRRORING, SCALE FACTOR

11.1 PROGRAMMED DIMENSIONS TRANSFORMATION


So far we have seen how positions are programmed with an instruction consisting of:
address containing the axis name
expression or numerical value representative of the value.
For simple and efficient programming it is possible to have the Z32 apply to the programmed
positions some standard transformations, namely:
1. roto-traslation
2. mirroring
3. scale factor
With these functions the CNC transforms the programmed positions into positions belonging to
new roto-traslated, mirrored, amplified or reduced figure.
The CNC operates on the programmed positions and not on the positions detected. This means
the positions displayed are always those related to the active origin and hence they are
representative of the real position of axis.
For example, if programming:
DA10 AA100
The position of AA axis at the end movement is 110 with reference to the active origin, and 110
will be the value displayed.
The parameters used for these functions are:
IR, JR coordinates centre of rotation
QR rotation
DA, DB, DC traslation
IS, JS coordinates centre of mirroring
QS inclination axis of mirroring
KP scale factor on the plane
KT scale factor third axis
KM fattore moltiplicatore singolo asse
KD fattore additivo singolo asse

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

11.2.1 Axes movements and rotation


We recall how Z32 acts in the absence of rotation.
If only one axis of the plane is programmed, the Z32 will not move the unprogrammed axis, even
if this contains a changed position, for programming reasons.
The following example shows the different result obtained when programming one or two axes
of the plane in different conditions.

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

11.3.1 Axes movements and traslation


Traslation alone does not force the movement of unprogrammed axes. Example:
X and Y parameters = 0 on N4 instruction and with traslation DB, DA locate the point of
coordinates X=40, Y=20. The end point is reached only by programming both axes (program 3).

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

11.4.1 Axes movements and mirroring


Mirroring, like rotation, can demand the motion of an unprogrammed axis.
So, in the same manner as for rotation, if while mirroring is operating (G56) one of the two axes
of the working plane is programmed, the Z32 will automatically consider the other programmed and
it will take it to the point corresponding to value of the relevant parameter.

D. ELECTRON 337
Chapter 11 - Rotation, Tanslation, Mirroring, Scale Factor CNC Z32 Programming Manual

11.5 SCALE FACTOR


KT=1 All elements of the plane that form the programmed figure are multiplied by KP (constant on the
KP=1al plane), while AC is multiplied by KT (constant on third axis). The modified elements of the plane
RESET are:
(AA, AB) axes positions
(I, J) circle centre
(RA) radius circle
Geometric elements of the tool are not modified by scale factor.
KP = KT = 1 on reset.

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.

11.6 MODIFICATION PARAMETERS FOR DIMENSIONS


To modify the programmed dimensions, the following parameters are available:
DA, DB and DC added to the programmed dimensions of the first, second and third axis
of the plane
KP multiplies both dimensions of the working plane as well as parameters I, J, and RA
(circle centre and radius).
KT multiplies the dimension of the third axis.
Other terms, multiplyng and additive, not referred to the working plane but to individual axes, are
also available. They have an cumulative effect on the above parameters.
For instance, in a machine with X Y Z B C continuous axes, the following can be programmed:

338
D. ELECTRON
CNC Z32 Programming Manual Chapter 11 - Rotation, Tanslation, Mirroring, Scale Factor

KMX KMY KMZ KMB KMC as multiplying terms


KDX KDY KDZ KDB KDC as additive terms
If KM or KD are not followed by a continuous axis name they are considered as normal
parameters. Therefore, there is no error if a part program already containing these KM or KD
parameters is executed.
The three-letter parameters above are parameters in all respects; that is, they can be written or
read and used in mathematical expressions.
They are all set to zero at reset.
The effect of KM or KD is suspended when G53 is active.
These compensation parameters affect only programmed dimensions. The real positions where
the axis are, are those displayed (therefore different from the programmed ones).
Unlike KP, that also affects centre coordinates and the radius, the KM compensation parameters
influence only dimensions. Their purpose is to modify the profiles obtained through a large number
of very short linear segments. On the other hand, they can scarcely be applied in the case of
circular programmed movements. However, it is up to the programmer to decide on a case by case
basis.
The effectiveness of dimension modification appears only after these parameters have been
programmed in ISO lines.
For example:
KMX1.035 KMY0.96
activates two-scale factors, one on the X axis and the other on the Y axis.
Programming KM or KD in an evolved line modifies parameters but cannot activate correction.
For example:
!KMX=1.5!
has the effect of modifying the KMX parameter. Still, the correction is not enabled if it was not
already enabled earlier. However, if the correction is already active, it will remain active with the new
parameter programmed in an evolved line.
WARNING:
As the line is analyzed, the modifying parameters are immediately enabled,
therefore the effect depends on their position on the line. If, in an ISO line,
the dimension of an axis is mentioned before the parameter modifying that
axis, then the programmed dimension is not modified.
The sequence used to apply the modifications is important as applying addition first and then
multiplication or vice versa yields different results. The sequence is:
1) Multiply by KM..
2) Add K..
3) Multiply by KT and KP
4) Add DA DB DC
The programming of very high KM or KD (resulting for example from an erroneous formula
where a division by zero is present) may bring to unpredictable results (depending on axes
characteristics) sith possible movement alarms CN0013. For this reason, the maximum allowed
value for KM or KD lower than 131072, a value certainly much higher than required by programming
needs, but small enough to not produce CNC internal computation errors. By programming values
higher or equal to 131072, the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.

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

12. TOOL RADIUS COMPENSATION

12.1 TOOL RADIUS COMPENSATION


When we program a profile with a numerical control, we generally do not know the radius of the
tool with which the profile will be executed: the tool may vary for many reasons (availability,
sharpening, different tool in rough machining and in finishing...).
The Z32 allows the profile of the piece to be programmed and it automatically executes the
changes to profiles depending on the present radius.
It is clear that the path of the milling centre (the motions of the axes of the machine) is different
from that which would be necessary to describe the programmed profile with a punctiform tool
(R=0).
In the example of the figure is shown the path of the milling centre (A...G) corresponding to the
programmed profile (1...6).

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:

Traslation of rectilinear segment by a quantity


equivalent to tool radius.

D. ELECTRON 341
Chapter 12 Tool Radius Compensation CNC Z32 Programming Manual

Radius reduction of an inner circle arc by a quantity


equivalent to tool radius. Elimination of the circle arc
if the resulting radius is negative.

Radius increase of an exterior circle arc by a


quantity equivalent to tool radius.

Insertion of a radius connection arc equivalent to tool


radius around an exterior corner.

Length reduction or elimination of programmed


segments that interfere with other segments of the
profile.

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

The next segment that interferes can,


depending on the type of profile, much further
ahead.

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

So the Z32 executes in sequence the following elaboration:


1) START HORIZONTAL SEGMENT
- segment 2 connects.
- segment 3 connects.
Three segments have been examined and so segment 1 is executed without changes.
2) CIRCULAR CONNECTION
- segment 3 connects.
- segment 4 intersects segment 2: segments 2 and 4 are consequently modified and
segment 3 is eliminated.

D. ELECTRON 343
Chapter 12 Tool Radius Compensation CNC Z32 Programming Manual

The procedure goes on until three segments have been examined.


In normal conditions the Z32 explores three segments: that is enough to resolve a large number
of practical cases.
But there are cases where the profile is incompatible with Z32 look-ahead
A limit case is a rectangular pocket of A width and of B depth (see figure), with BA (pocket
deeper than large). The segments composing the tool centre path are the following:
1) first horizontal segment
2) first circular connection
3) first vertical segment
4) bottom
5) second vertical segment
6) second circular segment
7) second horizontal segment

Three cases are possible in radius compensation:


1. tool diameter less than width (2*R<A)
2. tool diameter bigger than double width (R<A)
3. intermediate tool diameter
We shall examine Z32 performance for every case and for every segment.

TOOL DIAMETER LESS THAN WIDTH


Segment 1. Segment 2 connects, segment 3 connects: segment 1 is executed unchanged.
Segment 2. Segment 3 connects, 4 intersects 3 segment: segments 3 and 4 are
shortened, segment 2 is executed unchanged.
Segment 3. Segment 4 connects, segment 5 intersects segment 4: segments 4 and 5 are
shortened, segment 3 is executed (shorter because shortened earlier).
Segment 4. Segment 5 connects, segment 6 connects: segment 4 is executed.
Segment 5. Segment 6 connects, segment 7 connects: segment 5 is executed.
Segment 6. Segment 7 connects
The profile is executed correctly.

344
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 - Tool Radius Compensation

TOOL DIAMETER GREATER THAN DOUBLE WIDTH


The tool radius is greater than width: so the milling machine is much bigger than the pocket.
Segment 1. Segment 2 connects, segment 3 connects: segment 1 is executed.
Segment 2. Segment 3 connects, segment 4 does not connect and does not intersect:
segment 4 is eliminated. We proceed with segment 5 which does not connect
and does not intersect: also segment 5 is eliminated. Segment 6 intersects
segment 2: segment 3 is eliminated, segments 6 and 2 are shortened
consequently.
We proceed with segment 7 which connects and so segment 2 is executed (with 2 segments
ahead already explored).
Segment 3 Was eliminated.
Segment 4 Was eliminated.
Segment 5 Was eliminated.
Segment 6 Segment 7 connects...
The profile is executed only in part, because the tool leans on two corners, without going into
the pocket: however the tool does its best.

TOOL DIAMETER GREATER THAN WIDTH AND LESS THAN DOUBLE


The tool does not go into the pocket, but it is smaller than twice the width
Segment 1. Segment 2 connects, the 3 connects: segment 1 is executed.
Segment 2. Segment 3 connects, the 4 intersects the 3: segments 3 and 4 are shortened
and segment 2 is being executed (being two segments ahead). At this point
the CNC gives an irrecoverable error, because segment 2 must be shortened.
Segment 3. Segment 4 connects, the 5 does not connect and does not intersect: it is
eliminated. The 6 does not connect and does not intersect any segments (if it
had not moved to execution it would have intersected the 2): segment 6 is
eliminated. The 7 does not connect and it does not intersect: it is eliminated.
The procedure continues to the end of the radius compensation, because none of the
subsequent segments will connect with those examined, and so the control will give alarm:
INADMISSIBLE PROFILE.
Various cases can be examined in a similar way: generally when there are undercuts in the
profile smaller than the tool diameter, the INADMISSIBLE PROFILE cases may occur.
If the profile conditions demand a different number of explored segments, the programmer will
have the possibility to ask this of Z32. The G109 function must be followed by a letter from A to E to
specify the number of segments to be explored:
G109A three segments (active on reset)
G109B four segments
G109C five segments
G109D six segments
G109E seven segments
A case example solved completely with 7 segments (G109E) is indicated in the figure below.
Segment 1 intersects segment 8 (because the tool diameter is greater than the aperture). When
the CNC examines segment 1, segment 7 ahead already intersects segment 3 and segments 4, 5
and 6 are eliminated: the next 8 segment intersects segment 1 and so also segments 2 and 3 are
eliminated and segment 1 shortened.

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.

12.1.1 Connection to profile


The Z32 is forced into NO RADIUS COMPENSATION (G40) at program start.
G41 (tool on right) or G42 (tool on left) must be programmed for Z32 to go into RADIUS
COMPENSATION.
This moment of connection to profile needs a few special geometrical operations: the
programmed positions must no longer be interpreted as positions to which the tool centre must be
taken, but as positions of the piece profile: the path of the milling centre will be moved from the
programmed path by a quantity equal to the tool radius.
There are characteristic ways of programming connection to profile other than those described
in the Chapter on Geometry.
We will use X and Y axes to indicate the first and the second axis of contour plane, but if it is
different (with G25..) the axes could be different.
After G40, G41 and G42 the modal G1 is active and therefore there is no error if positions
compatible with G1 programming are given.
However, G0 programming (only after G40) or G2 or G3 in the step that follows G40, G41 or
G42 is valid and accepted.

Radius correction and lathes


On lathe systems, the tool radius vector compensation must be activated before the
programming of G41 or G42. Please refer to the G150 function.

346
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 - Tool Radius Compensation

G41/G42 - X... Y... QF... programmed - tangency connection


Together with the preparatory function G41 (start radius compensation with tool on right) or G42
(start radius compensation with tool on left) are programmed:
two end positions of working plane
end inclination of connection segment
The end inclination is programmed as described in the Chapter Geometry.
The connection to profile is done with a circle arc which brings the tool centre to brush the
programmed point, ready to execute a segment starting from the programmed point with QF
inclination.
The length and the curvature of the circle arc are calculated automatically by CNC and they
depend on start point of connection.
The movement of the tool for three different connections to profile with end inclination zero is
illustrated by following examples.

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.

G41/G42 - X... Y... programmed - rectilinear connection


Only the positions of start point of profile are programmed.
Start movement of connection is straight segment, which is treated like a profile element and,
therefore, can be shortened if there is interference with other profile segments.

....
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.

G41/G42 - QF... programmed - rectilinear connection


Only start inclination is programmed: it can be calculated very roughly on real profile without
errors.
Axis movements are not produced.

......
T1 M6 (RADIUS 10)
G0 X0 Y0
G41 QF0
G1 X25 Y0
G1 X50 Y35
...

There is no movement in G41 QF block. If QF is incorrect (as in figure, 0 instead of circa 20


degrees) the error is only in G1 segment, which returns the tool to the first real point of P1 profile,
but there are no errors on the piece because the tool is still out.

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

The G41/G42 X Y I J executes a linear approach without need to overlap.


This mode considers a profile initiating in the programmed point (X Y) in the same direction
assumed by a circular segment with center I J. The profile approach movement is therefore a linear
element bringing the tool center on the line running from the center (I J) and the final point (X Y), at
a distance from the final point equal to the tool radius (R).
The following cases bay exist:
- if the first profile segment is a circle, I J may be its center
- if an orthogonal approach is desired, I J may be the tool center at the beginning of the profile
approach (thus coinciding with the previous final point)
- in every case I J may be any point lying on the line orthogonal to the profile in the approach
point, from the tool side.

G41 /G42 - without dimensions


The following type of sequence can be programmed, for example.
...
N20 G41 (without any dimension)
N21 G1 X10 Y4 (G1 can be omitted, both dimensions are compulsory)
N22 ...
N21 specifies the first point of the profile to be reached in radius compensation.
N22 contains the first radius compensation movement, which can be any of those permitted by
the geometry of Z32 starting from point N21.
The movement to connect to the profile will take the tool on a tangent to the profile in the point
programmed in N21 (the tool centre will be on the vertical to the profile in point N21, at a distance
equal to the radius).
With this type of connection a closed profile can be programmed (e.g. with the last segment
closing on point N21) without leaving the little tooth of material that occurs by specifying the
dimensions of the first point in the same line that contains G41.

12.1.2 Detachment from the profile


The detachment from the profile is similar to connection to profile (preceding paragraph): also in
this case the CNC must change the meaning assigned to the programmed positions, going from
profile positions to tool centre positions.
G40 is the function to be used.
The movement type (G0, G1, G2 or G3) must be programmed in the first block of movement
after G40.
G40 X... Y...
The CNC executes a circular segment tangent to the last segment of the executed profile and
brings the tool centre to the final point programmed.
G40 without dimensions
If the end positions of connection are not programmed the radius compensation will be stopped
directly on the end point of the programmed outline: the next block will have the coordinates of the
tool centre as start point.
If G40 is programmed at the end of a radius compensation accompanied by G0 and a position,
e.g. with

D. ELECTRON 349
Chapter 12 Tool Radius Compensation CNC Z32 Programming Manual

N30 G40 G0 Z20


the alarm CN1D14 will appear.

12.1.3 Feedrate control


The programmed FEED is generally the feedrate with which the programmer wants the profile to
be outlined by the tool.
Normally the CNC keeps the feedrate of the milling machine (according to the permitted
dynamic acceleration limits) constant and equal to the programmed F
During radius compensation, the programmer normally wants to keep constant the feedrate on
the profile, which is that of the tool periphery rather than the centre.
The feedrate of the centre and the periphery of the tool are the same for rectilinear segments,
but are different for circular segments.
We have an increase in the peripheral feedrate with respect to the centre in internal arcs, and a
decrease in external arcs.
During radius compensation, the Z32 keeps as constant as possible the feedrate of periphery
rather than the tool centre. However, an increase of feedrate of the tool centre with respect to
programmed feedrate is EXCLUDED. This is to avoid problems during rough-machining where the
milling by full is possible.

12.1.4 Zero or negative radius


The tool radius may be zero or negative: we will have the execution of the programmed profile
with zero radius, instead we will have the equivalent of an exchange between G41 and G42 with
negative radius.
Negative radius may have sense when the profile has already been calculated (for example by
automatic programming system) for typical milling radius, and when radius compensation is
performed by the operator on the machine to correct any wear or difference in the tool used.
In this case care must be taken; since the radius communicated to the Z32 is only fictitious, we
lose adaptation to the feedrate and the consistency of the peripheral feedrate: the FEED has got to
be programmed again in the steps where this adaptation is needed.
In the case of tools with a very small radius (less than circa 3 micron) there can be errors on the
interpolated profile of a maximum of circa 2 micron, which will be tolerated without difficulty in any
application insofar as they are lower than the other errors that affect the final result (tracking,
temperature, tool geometry errors). If, however, errors of this type are not tolerated it is
recommended that tools with very small radius not be programmed (i.e. the physical tool radius is to
be programmed and not the compensation with respect to the theoretical radius).

350
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 - Tool Radius Compensation

12.1.5 Single block


As the single block mode is enabled, the machine stops and pressing the START button
executes one block at a time (block meaning an elementary operation. In a line, there can be
several elementary blocks).
Operations are as follows:
As the single block mode is enabled, the CNC will try to stop the axes precisely at the
end of the current movement.
If this mode is activated after the end of the movement this will not be possible as the
axes must decelerate according to the acceleration limits in machine settings. In this
case, motion continues to the next block until the axes come to a stop. This could
therefore occur at an intermediary point and not at the end of the block. If the profile is
made of a large number of short segments, the stop is likely to occur after several
blocks.
When axes are still and single block mode is enabled, pressing the START button only
once will start the motion.

12.1.6 Closed profiles in radius compensation mode


Let us take the following program an example of a closed profile in radius compensation mode:
...
N10 G0 X-40 Y0
N11 G41 X-20 Y0 QF0
N12 G1 X0 Y0
N13 G2 X0 Y-40 I0 J-20
N14 G2 X0 Y0 I0 J-20
N15 G1 X20 Y0
...
The execution of a complete circle programmed using two semi-circles N13 and N14 depends on the
calculation approximation used (this depends on the radius, on the programmed dimensions, ....)
An infallible way to execute this circle is to add a "G109X" in the N14 line to force passage
through that point. However, programmers may dont like this trick, which is not common in other
CNCs.
Z32 incorporates the recognition of a closed programmed profile. If the profile is closed (which is
easy to detect as the end points of two blocks coincide), it executed in any case.
Indeed, the CNC is believed to be able to "interpret" the intent of the programmer in this regard.
In the case in question, a closed profile is acknowledged as such because the N12 and N14 end
points coincide thus forcing the execution of the circle.
Any motion by the third axis is not taken into consideration, that is, a profile is acknowledged as
being closed even if the third axis has moved in the meantime.

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

13. SPECIAL PERFORMANCES

13.1 MEASURING PROBE - G61


The Z32 has a complete measuring cycle which is very simple to use and set up, thanks to
management of the physical dimensions of probe head.
To carry out the measuring cycle the manufacturer must arrange the machine with suitable
settings.
The block with measuring movement is formed by:
G61 AA... AB... AC... DM...
G61 preparatory function, which begins the measuring (valid only in the block).
AA, AB, AC are the maximum end positions of search movement (as usual X, Y and Z axis
names can be used which must be the three axes of the triad, chosen with G25).1, 2, 3
dimensions can be programmed, again chosen from the three of the triad.
DM is the distance, measured on the path, from the end point within which contact is expected.
If DM is not programmed in the block the CNC uses the present value of the DM parameter. (=0 is
never programmed)

The cycle executed is:


1) Traverse approaching (A-B in figure): if the contact is found in this section, the
measuring is taken anyway, but with possible risk for the probe head due to the high
stopping distance.
2) Search at average speed to the C point.
3) When the contact is made, the direction of motion is reversed at double acceleration
with respect to setting and a return until contact is lost. During motion reversal at
double speed the tracking error alarm is temporarily suspended.
4) Forward search at very slow speed.
5) The precise dimensions are taken when contact is made and are returned in the form of
parameters.
If contact is still active at point 3 when the axes have returned to initial point (A in figure) the
CNC gives alarm CN0513.

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.

The parameters: L, AN, AP, BN, BP, representative


parameters of physical size of the tracing head must be
already present in memory: they can be in the description
of the tracing head tool and must be calculated in advance
or better still measured automatically with the special
calibration macro.

The following figure shows a speed diagram function of


time, for a complete measuring movement. The feedrate is calculated on the path, like in G0/G1.

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.

13.1.1 G61 measuring cycle with a single contact


The double contact procedure permits excellent precision levels but takes more time, it is for this
reason that a G61 mode has been made available with single contact.
The operating cycle consists in:
1 rapid approach movement
2 slowing at search speed
3 value recording at the time of contact and return in the form of parameters
This mode is engaged by programming the parameter "J" in the line of G61:
G61 Z-100 DM20 J100
Parameter J defines the search speed, expressed in mm/min o inches/min, therefore in the
example a speed of 100 mm/min is required (if the machine is in mm). The range of permitted
values for parameter J comes within a minimum of approx.0,23 mm/min and a maximum of 6000
mm/min.
The maximum value of 6000 mm/min is fixed and independent of the search speed values set in
calibration stage.
Values outside this range admitting that they are forced to the nearest limits, in particular
negative values, are forced to 0,23 mm/min.
During the measurement movement the machine axis must stop immediately when they
encounter the probe signal, this results in sudden accelerations which may not be compatible with
the dynamics of the machine axes, in particular in the event of rigid axis control (G113X).
Due to the fact that when J is programmed, the values permitted for the measurement
movement are very high (up to 6000 mm/min) it is necessary to force the G113P, the following
function table is therefore obtained:

Active mode before G61 Mode during normal G61 (w/o J) Mode during G61 with
programmed J

G113P G113P G113P

G113F G113F G113P

G113X G113P G113P

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:

Search speed mm/min measurement uncertainty micron


30 1
100 3.3
200 6.7
300 10
It is also necessary to remember that at high speeds there may be considerable delays due to
the machine response to the probe, which have obviously not been taken into account in the above
table.

13.1.2 G61 KA1 measuring cycle on rototraslated planes


With G116 active and by programming G61 KA1 on parameters AM, BM, CM, the measured
values of the axes XYZ are returned, expressed in the system of roto-traslated coordinates by G116
(G61 without KA1 returns them in the straight coordinate system). If G116 is not active G61 KA1
acts exactly as G61.
To enable G61 KA1 simply program parameter KA1 in any position on the activation line of G61.
Examples:
G61 X0 Y0 Z18 KA1 DM2
G61 KA1 X10 Y5 Z25 DM2
Some application samples follow.

13.1.3 Macro for probe calibration


Purpose: to define and to write corrective parameters L, AN, AP, BN, BP in the probe tool
description.
A HR radius ball, or even better 2*HR side cube, with a centre in the active origin is assembled
on the machine.

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.

13.1.4 Macro for zeroing of XY origins at the centre of hole


To zero current origins at the centre of a hole.
Input parameters:
HR hole radius
HT tolerance
HA Z position (measuring)
HC Z position (exit)
AP,AN,BP,BN,L probe correctors
Output parameters:
DI, DJ hole centre offset
OX* and OY* updated at hole centre

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

13.1.5 Block Search with measuring movements


In this example it is suggested how to safely perform a block search procedure when the
program contains measuring movements.
The program memorizes in a local parameter section the results of the various measurements
made in order to be able to use them later in block search to restore the conditions existing during
the real program execution.
EXAMPLE OF PROGRAM%
G37PL local parameters
... measuring to determine AM and BM
//N9 !:RPM1=AM, M2=BM only in block search, read the memorized results
N10 G61 ... the parameters which are interesting are AM and
BM: in block search they are not modified
N11 !: WPM1=AM, M2=BM! it memorizes the result for a next block search
... it measures to determine CM
//N30 !:RPM3=CM!
N31 G61 ...
N32 !:WPM3=CM!
N33 ... it measures to determine AM BM CM
//N63 !:RPM4=AM, M5=BM, M6=CM!
N64 G61 ...
N65 !:WPM4=AM, M5=BM, M6=CM!
...
M2
:PA
M1=0
M2=0
M3=0
M4=0
M5=0
M6=0
...
After the real program execution (not in block search) the results of the various measurements
made will be written in M1, M2, M3, M4, M5, M6, at the beginning they where =0.

13.2 MOVEMENT WITH STOP BY PLC G62


The use of G62 is reserved to the machine tool manufacturer for canned cycles or system
subroutines, because a close interface with the PLC is required. If necessary it can be used by end
user but only if the machine manufacturer provides special instructions.
G62 is active only in the block, and it requires a stop at the beginning or the end of the
movement (that is, the movement must not belong to a profile which is open or with radius
compensation or G33).
This G function allows the programmed movement to be interrupted by means of a PLC signal
(bit 0EC).

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).

13.3 BLOCK SEARCH PROCEDURE WITH SPECIAL FUNCTIONS


The block search procedure of Z32 permits to restart an interrupted program with extreme
safety, because it forces the central processing unit to repeat the same calculi as in the normal
execution.
This holds true for normal programs, when the information available to Z32 is always identical
inside a program, even in subsequent executions of the same program.
In some cases it is not possible to have some information (available in normal execution) during
block search procedure, whilst in different cases it may change because changed at the source.
Anomalous sources of information and the general way to solve the related problems are
examined in the following paragraphs.

13.3.1 Data reading from CMOS memory


Z32 reads CMOS memory with evolved instruction :R . With this operation we can read:
origins
parameters
data in the tool description
The data memorized may be changed by the part-program itself and therefore not be repeatable
in subsequent executions that require particular performances, as:
origin movement

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.2 G101 Data from PLC to part-program


The part-program can ask the PLC with G101 instruction information on the physical state of the
machine (particular equipment, piece identification etc.).
The physical state of the machine seen in block search may be different from that seen in
execution, both because the functioning of the logic is different in the two cases and because the
physical state may have been changed by the execution of the program itself.

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.

13.3.4 Solving example


From the few considerations expounded in the previous paragraphs it is evident that
innumerable different situations exist and that each may require an appropriate solution.
D. ELECTRON has not, therefore, tried to solve the problem in a general and automatic way, but
has left the programmer the task of determining the most appropriate solution case by case.
The instrument recommended for general use is that already described in the paragraph on
Block Search with Measuring Movements.
In regard to measuring movements alone:
Generally, if a program that can be interrupted and then started again without complications for
the operator is desired we should:
1) Identify the points of the program where the information that change are read during the
execution. Of particular importance are:
:R evolved operations
origins recall (example OX1 etc.)
G101 operations
G61 or G62 movements
2) Create in the parameters section (preferably local) a number of parameters
representative of variable information received during the execution.

362
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances

3) Memorize variable results received during the execution


4) Insert double barred blocks so that in block search procedure the values are replaced by
those memorized in the parameters section by the previous execution.

13.4 CYCLICAL CONTINUOUS AXES


A continuous axis defined as cyclical features some functions that need some explanation.
The following observations are based on the hypothesis of a "B" axis (in degrees) with 360-
degree cyclicity.
One transducer pitch of this B axis is at 0.001 degrees. This means that a complete revolution of
the counter (that is about 268 million for 28 bits) comprises about 745 revolutions of the B axis, that
is, about 268,000 degrees (exactly 268,435.456 degrees).
It can also reasonably be assumed that the stops of the B axis have been set at their maximum
(therefore practically eliminated).

13.4.1 Acquiring the initial point


The CNC acquires the positions of the axes in given instances and starts with the programmed
motion from that point on. These instances can be one of the following:
At start-up (this involves all the axes)
At reset (this involves all the axes)
When enabling an axis (G28) after having disabled it (G29)
In the case of normal axes, the position is single and not equivocal and coincides with the
physical position of the axis.
In the case of cyclic axes instead several positions are possible (one for each revolution): at
start-up, at reset and upon activation (G28), the position acquired is the one (positive or negative)
not exceeding half of a revolution.
As regards the B axis described earlier, if the physical position is at 359 degrees, the acquired
position will be -1.

13.4.2 Programming more than one revolution


If, for instance, the B axis is at 10 degrees, we can program a complete revolution using B370.
From the point of view of programming, a continuous axis is not cyclical (unless defined as
cyclic axis position by shortest route): therefore an indefinite number of revolutions can be
programmed.
Up to five integers are available, which means that we can program up to 99999.999 revs.
Mathematical formulae allow to go even further (the floating-point format of the Z32 can handle
numbers with up to nine significant digits).
In particular cases, we may need an even higher number of revolutions: in this case, we can use
a G29 and G28 cycle to start again from the beginning. At the G29, we can start from a very low
number because we acquire the initial position by using the method described earlier.

Important note on the programming of indefinite rotary movements


Let us imagine that we have a rotary C axis with cyclicity of 360 degrees, and imagine that we
wish to make it rotate indefinitely in a direction. It is wrong to program:
N1 C<C+179>
!GON1!

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!

13.4.3 Acquiring a Dimension using G105


The dimension acquired by G105 (which transfers the current dimension in the axis name
parameter) is the closest to zero. For example:
N1 G0 B0
N2 B3599
N3 G105
The dimension acquired after G105 is -1.
Please note that if we had programmed
N4 B<B>
the B axis would make 10 revolutions backwards (from B3599 to B-1)

13.4.4 Repositioning after a block search


After a block search (or if execution is resumed after an error), repositioning may be required.
The repositioning is never higher than half a revolution even if we programmed several
revolutions for the physical position of the axis.
For example:
N1 B0
N2 B36000
N3 B36001
Supposing that the axis is at zero (this position is the same as 36000 after 100 revs) and that a
step is searched at N3: the physical position is 100 revs. different from that programmed. However,
repositioning is not required because, for this purpose, position 0 and position 36000 are identical.
The display of the dimension for cyclical axes is positive or negative around zero by half a cycle.

13.4.5 Cyclical axes by the shortest route


We could have defined continuous axes as cyclical, but not to the effects of programming: the
cyclicity of the axis was only used to avoid the saturation of the physical counter and affected the
initial dimension acquired using G28. Once the initial dimension was acquired, programming was
absolute (we could also have programmed more than one rev).
A calibration allows the assimilation of cyclical continuous axes as cyclical axes in all respects.
For these axes, regardless of the programmed dimension and of the initial position, we obtain the
displacement by using the shortest route.

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.

13.5 MACHINE IN INCHES


Z32 can use inches.
Here is a list of the various interesting aspects of this mode:
When defined as specified above, inch mode has the following effects:

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.

13.6 MACHINING OFFSETS DRIVEN BY JOG BUTTONS


(OFFSETJOG)
Mainly in molding machining, it may be useful to create machining offsets during an automatic
execution. This can be obtained by using the fixed JOG keys of Z32: JOGX+, JOGX-, JOGY+ ...
The OFFSETJOG feature allows to define a machining offset, driven by the JOG pushbuttons,
during the automatic execution.
This feature must be enabled by the machine tool builder, which is responsible to implement the
appropriate modifications to the PLC program; please refer to the information delivered by the
machine tool builder.
If this feature is enabled:
- if a space jog is commanded (increments of 1 mm, 0.1, 0.01, 0.005), the pressure of a fixed
jog key commands a displacement of the axis position equal to the selected space step.
- if no space jog is selected, the axis moves in the direction corresponding with the pushbutton
with a micrometric speed (2 mm/min) until the button is pressed,
It is possible to create offsets only during the execution, i.e. after starting an automatic or
semiautomatic program. Please consider that the execution status of the Z32 begins after choosing
the program and remains until program end or reset. It is therefore possible to create offsets also,
for example, during a block search.
Attention: The OFFSETJOG feature can be defined as transparent at RESET. With this setting,
the offsets created persist even after a RESET. For this feature, please consult the machine tool
builder.
Only alive continuous axes (except rotating axes connected to a dynamic G117 on these axes
the G124 may be used) can be subject to offset.
If an offset is created on an alive continuous axis and this axis is then switched to non alive by
the part-program (with G29), the axis remain in its position, but the offsets are lost; if the axis is
subsequently switched alive by the part-program (with G28) the offsets are reset to zero.
A reset clears all the offsets.
The movement generating the space offset is executed with speed and time according to the
space chosen:
space in mm 1 speed in mm/min 60 time in sec 1
0.1 11.7 0.51

366
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances

0.01 4.7 0.13


0.05 2.3 0.13
On machines in inches, the speed remain the same, but the space changes:
space in inches 0.1 speed in mm/min 60 time in sec 2.54
0.01 11.7 1.3
0.001 4.7 0.32
0.0001 2.3 0.065
Once activated, the space jog movement will be completely executed, also if the pushbutton is
released. The space jog movement is interrupted only if:
- the STOP pushbutton is pressed
- the axis becomes unavailable for offset (G53, not alive, end of program, end enable)
The programming of G53 removes and clears all offsets. If the G53 is deactivated by G54, all
offsets are reset to zero. If G53 is inserted in the tool change sequence (normal situation), the tool
change clears all the offsets.
The displayed positions are the programmed positions: the displayed position doesnt change if
the jog offset is changed.
The G105 function (transfer of actual positions in axes parameters) reads the displayed position
and not the actual position. For example, if X100 was programmed and a jog offset of +3.784 mm
has been build up (actual position X103.784) the X parameter is initialized by the G105 to X100.
The forecasted travel limits cannot take into account the jog offsets, because they act at part-
program level, while the jog offsets act in real time.
The forecasted travel limits are still active and consider the normal working field, without
considering the effect of the jog offset.
Furthermore, in case of non zero jog offsets, some errors may be triggered also by the real time
travel limits (in case of permanent formulas or G117 rotations) capable to issue CNEx13 alarms
(closeness to the travel limit) or CNFx13 (too high speed toward travel limit).

13.7 SPECIAL REPOSITIONING IN RTCP


This feature helps in solving the following situation: a machining in a slanted groove is executing
(with slanted head and G117 active); during the execution, the machining is interrupted and the tool
is extracted from the groove.
The machining must then be restarted from the point it were interrupted: the solution is to
execute a block search and then switching to auto execution; if the feature is enabled the CNC
executes a special repositioning composed not only by single physical axes movements.
This feature must be enabled by the machine tool builder, which is responsible to implement the
appropriate modifications to the PLC program; please refer to the information delivered by the
machine tool builder.
This repositioning is composed by the following phases:
1) The list of the axes to be repositioned contains the rotating axes, also if not connected to
G117, and all linear axes out of position, but not the axes with numlog 0, 1, 2 (driven by the motion
of the rotating axes connected to G117) Consider that the repositioning of the rotating axes
connected to G117 drives a motion on the XYZ linear axes. If G118 is active, it is disabled during
the whole repositioning sequence, and re-enabled only after all the axes have been repositioned.
Once all the axes specified in point 1) have been repositioned, the repositioning of the axis with
the lowest logic number (0, 1, 2), but not coinciding with the tool axis, is proposed. Consider that the
repositioning of this axis is executed in the rotated reference system, according to the head angles.

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.

13.8 DISCRETE AXES


One discrete axis has intermediate characteristics between those of continuous axes and
indexed axes.
Continuous axes are the normal working axes of the machine (commanded by the part-program,
capable of interpolation, jog movements, etc.). The indexed axes are instead only accessible by the
machine logic: the machine tool builder define the auxiliary functions (M, MA, MB or MC) capable to
command the positions of these axes.
In some case (typical case a rotary table capable to work only blocked by a toothed crown with 1
degree pitch) it may be useful (responsibility of the machine tool builder) to define a discrete axis,
intermediate between a continuous axis and an indexed axis.
From the programming point of view, a discrete axis has the following characteristics:
- it is a normal continuous axis (expect for the limitations explained below), therefore
commanded by part-program and semiautomatic and subject to jog movements.
- only integer positions may be commanded, otherwise the alarm CN2C14 NOT
COMPATIBLE PARAMETERS is issued. Please be careful considering the computing
approximations, if a numerical value is obtained through a mathematical formula: If B is a
discrete axis and, for example, B<2/5*5> or B<2.5*5> is programmed, the alarm is triggered
(the value obtained is about 2.0000000018, not an integer number). As a general rule, avoid
the use of divisions and fractional numbers in mathematical formulas; additions,
subtractions and multiplications preserve instead the integer numbers. Warning: if RESET is
pressed during the execution, the axis is frozen in its actual point, also if not integer.
- the axis doesnt allow supplementary origins. A discrete axis is always referred to the base
origin, both with part-program and jog activity.
- it doesnt allow permanent formulas.
- it cannot be inserted in the working triad. If the programming of G25 contains a discrete axis
in its list, the alarm CN2C14 NOT COMPATIBLE PARAMETERS is issued. Consequently,
the discrete axis may only be inserted in a G0 or G1 linear interpolation. No circular
interpolation, nor radius correction are allowed.
- in jog, a movements queue is maintained until the nearest integer is reached. For example,
if the velocity jog pushbutton is released when the axis is at 2.499, the axis stops at 2.000; if
the axis was at 2.501, it goes to 3.000. Warning: if RESET is pressed during the execution,
the axis is frozen in its actual point, also if not integer.

368
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances

- in case of activity 7 (axes zero) it is advisable to program a subsequent positioning on a


integer position. For example, if B is a discrete axis, it is useful (in order to avoid the axis
stop on a wrong position) to command 7 ENTER: B0 (or B1 or B2 etc).

D. ELECTRON 369
Chapter 13 - Special Performances CNC Z32 Programming Manual

370
D. ELECTRON
CNC Z32 Programming Manual Chapter 14 - Obsolete features

CHAPTER 14

14. OBSOLETE FEATURES

14.1 G98 SPECIAL LINEAR INTERPOLATION (5 AXES)


It is frequently needed to program complex profiles, in the plane and in the space, which cannot
be simply represented with linear or circular segments (in the plane), or with linear or helical
segments (in the space). In this case, the commonly used method is to program a sequence of very
short linear segments, approximating the curve and the surface to be obtained. The approximation
precision is better if segments are shorter.
The workpiece programs to be inserted in the CNC with this method are normally very large: end
points of segments composing the profile, are often obtained by an external computer and directly
transmitted to the CNC (without any manual intervention of the operator).
With the usage of G1 (possibly G12) movements, the execution of such a program is possible
(up to three simultaneous axes), but with a scarce efficiency, for the following reasons:
too long elaboration time for a single G1 segment, therefore slow execution speed
the single linear segments are assumed to represent a real profile, therefore requiring
the most precise reproduction of programmed corners (obtained instead by the
approximation with linear segments)
in case of three simultaneous axes, there are limits to the maximum slope for the third
axis if G12 is active, or positioning and stop at the end of each segment if G12 is not
active.
The G98 interpolation allows to improve the Z32 behavior in all the above listed aspects,
allowing also to interpolate up to 5 simultaneous axes.
G98 prepares the Z32 to receive a sequence of linear segments to be executed in feed.
G98 is a modal, stopping function.
All programmed axes must be alive. If an attempt to program a not alive axis when G98 is
active, the alarm CN3A14 ALIVE NOT ALIVE is issued.
Prohibition G98 is deactivated by G99.
When G98 is active, the following is prohibited:
G programming (except G99 and G26)
origin, L, M, MA, MB, MC, S, T programming
radius correction
permanent formulae <<...>> programming
These limits have been introduced to optimize the execution speed in the most common usage
modes.
When G98 is active, the following is instead allowed:
F programming
evolved lines execution
permanent formulae <<>> execution
jumps to permanent subprograms
Note that formulae (<<>>) and subprograms (G27P) cannot be activated when G98 is
active, but if they were active before G98, they remain active and executed during the G98.

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.

14.1.1 Following error


This paragraph is dedicated to the expert programmer needing a deep understanding of the
effects of G98 on the machining.
In a CNC system, paths to be executed are computed with fixed time intervals from the
interpolator; for each computed point, the actual axes positions are controlled, while at the same
time a velocity command is issued to the axes, in order to recover possible position errors, thus
maintaining the computed path.
Two main classes of CNC systems exist:
A) Systems with proportional error. In this kind of systems, the velocity command sent
to the machine tool axes is proportional to the following error, thus resulting NECESSARY
for the axis movement. The axes follow the position computed by the interpolator with a
trailing error depending on the velocity, machine readiness, etc.
B) Systems with error correction. In this kind of systems the velocity command is
corrected in order to cancel the theoretical following error, if the velocity remain constant
along the path. Computed point position and axis position are coincident, except for small
errors due to setup errors and normal perturbations on the regular axis motion.
Both systems present advantages and disadvantages. The system A, simpler from the
computing point of view and the only used at the beginning of numerical control, has a smoother
movement, but greater path errors with respect to system B.
Z32 uses system B for normal G1, G2, G3 movements, in order to obtain the maximum profile
precision. The following error is compensated and theoretically zero, except setup errors and
external influences.
In case of paths approximated with line segments of small length, type B systems are
disadvantaged for many reasons, mainly because of the greater volume of computations to
execute; the requirement to exactly reproduce all programmed corners (not really present on the
profile, but resulting from the segment approximation), the computation difficulty related to braking
distance (the needed braking space may include many segments before the end point).
When G98 is active, in order to optimize the result, Z32 switches in proportional error mode
(type A system).
The resulting following error is done by the formula:
e = v / kv

372
D. ELECTRON
CNC Z32 Programming Manual Chapter 14 - Obsolete features

where e = error in mm., v = axis velocity in mm./sec., kv = axis gain in 1/sec.


As practical example, if F=1000 mm/min, kv=20/sec, the resulting following error is:
e = 1000/60/20 = 0,833 mm.
This following error doesnt correspond to the profile execution error, because the following error
is typically parallel to the profile. In particular:
1) if the profile is linear and parallel to the axes, no profile error is generated
2) if the profile is linear and sloped, a profile error is generated only if the kv of all
interested axes are not the same. The maximum error, if the kv differences are small, is
encountered on plane paths with a slope of 45 degrees, and its value is:
eb = e * d / 2
Where e is the path error defined above, d is the percent error between the kv of the two axes
interested to the movement. For example, if F=1000 mm/min, kv1=20/sec, kv2=22/sec:
e=0,833 mm d=10%=0,1 eb=41,7 micron
3) if the profile is curved, another error is added to the preceding, because the axes
remain always inside the curve, but never reaching it. This error is done by:
ec = e * e / (4 * r)
Where e is the path error defined above, and r is the curvature radius. For example if r=50
mm, F=1000 mm/min, kv=20:
e= 0.833 mm ec= 3 micron
These errors are not present in the normal Z32 mode, because they are compensated by the
axes controller.
Because the standard setup values are defined for the very small errors produced in normal
mode, when G98 is active and with high F, the following alarm may be generated:
CN0013
It is therefore advisable to check (for example executing long segments parallel to the axes in
G98) if the error CN0013 is triggered at the maximum velocities desired in G98; consider the
possibility to increase the error thresholds (operation reserved to the machine tool builder).

Increase of the error threshold in G98


With the function G113P the proportional error may be produced also with rapid movements of
the machine.
This brings to a big increase of the following error. For example, if the rapid is 30 m/min (=500
mm/sec) and Kv=30 the following error during the movement becomes 500/30=16.7 mm.
Because the error allowed during a movement with normal setup data is low (between 2 and 4
mm), in this condition, the threshold would be overcome, bringing to an alarm CN0013.
An automatic adjustment increases 8 times the error allowed during a movement, when G98 or
G113P are active.

CNDx13 errors. Tighter axes movement check


The errors related to axes movement are:
CN0013: error during the movement
CN0113: error during positioning
With the increase of rapid velocities and with the always more frequent usage of smooth
motions (G98 or G113P) the necessity to increase the threshold for the error CN0013 has aroused,
bringing to abnormally high values.
A much tighter axis movement control has been introduced, checking their responsiveness to
velocity commands. The control is active on all machine operating modes and on all axes, included
indexed axes, and axes commanded by the logic.

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.

14.1.2 Second acceleration management


Below, a short discussion regarding accelerations during movements and Z32 is made.
The limit on second acceleration is useful in all situations, included velocity changes during the
machining, in case of very short segments programming.
The effect of this management is a smoother axis behavior and a lower impact on the workpiece
finishing, due to velocity changes caused by slowing down in correspondence of corners or curves
with small radius.
The effect of n setup parameter (n single for each axis and ntar global for all axes) is stronger
thanks to this management, especially with high n (4 or more): in these cases the final positioning is
smoother, but also slower. It may be advisable, because of the better second acceleration
management connected to n. to not use high n setup values.

14.1.3 G99 and maximum velocity


Because all axes are delayed with respect to the interpolator, in type A systems (proportional
error) it is possible to suddenly stop the interpolator without producing overshoot on the final
programmed position.
This brings to a big simplification on the velocity management, mainly when the profile is
composed by very short segments, because it is not necessary to explore many segments in
advance to detect the exact braking point: it is sufficient only to stop the interpolator and all axes
assume their final position.
This characteristics is used by Z32: to terminate the G98 interpolation it is sufficient to program
G99 (also without positions).
The overshoot on the final programmed position is avoided with velocities smaller than:
vmax = 120 * a / kv
where vmax is in mm/min, a is in mm/(sec*sec) kv in 1/sec.
Typical machine tools accelerations range from 500 to 2000 mm/sec/sec, Related kv range from
15 to 25 /sec. Therefore, maximum allowed velocities range from 4000 to 9600 mm/min, more than
sufficient for machining movements.

374
D. ELECTRON
CNC Z32 Programming Manual Chapter 14 - Obsolete features

14.1.4 Practical considerations


Starting from the theoretical considerations discussed above, some guidelines for the G98
application may be found:
always use G98 in case the profile must be approximated with linear segments
check the feed velocity (F) with movements parallel to the axes producing the error
CN0013 and NEVER program same or higher feed in G98 if higher feed are desired,
please consult the machine tool builder to increase the error thresholds
try to approximate the profile with not too short segments, in order to avoid limiting the
execution feed
consider a further velocity reduction in case evolved lines or expression computing are
inserted
also with long segments, avoid to program F higher than 2000-3000 mm/min, in order to
avoid overshoot on the final programmed position at profile end (G99): where necessary,
program a reduced feed for a path segment of at least 5-10 mm, before G99.
consider the higher execution errors produced in G98 with respect to normal mode.
Errors may be of some hundredths of mm in normal working conditions: where
necessary, consider that a speed reduction, proportionally reduces this kind of errors.

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.

ELLIPSE WITHOUT RADIUS CORRECTION%


N1 T1 M6
N2 F400 S1500 M3 working parameters
N3 OX1 OY1 OZ1 working origins
N4 HA60 HB120 HF1 HT<HF> semiaxes, increment, initial angle
N5 G0 X<HA> Y0 Z0 positions on a vertex of the ellipse
N6 G1 Z-10 feed descent
N7 G98 may be programmed alone
N8 HT<HT+HF> X<HA*CSHT> Y<HB*SNHT> next point
N9 !IF HT<360;GON8! repeat

D. ELECTRON 375
Chapter 14 - Obsolete features CNC Z32 Programming Manual

N10 G99 X<X> position not mandatory with G99


N11 Z0 G1 motion, active before G98
N12 M2

ELLIPSE WITH RADIUS CORRECTION %


N1 T1 M6 R is contained in the tool description
N2 F400 S1500 M3
N3 OX1 OY1 OZ1
N4 HA60 HB120 HF1 HT<-HF>
N5 G0 X<HA+R> Y0 Z0 vertex corrected by the radius
N6 G1 Z-10
N7 G98
N8 HT<HT+HF> HC<HA*SNHT> HD<HB*CSHT>
N8,2 HE<R/RQ(HC*HC+HD*HD)>
N8,5 X<HA*CSHT+HD*HE>Y<HB*SNHT+HC*HE> ellipse point
N9 !IF HT<360;GON8! repeat
N10 G99 X<X>
N11 Z0 M2

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

You might also like