PROGRAMMING MANUAL

( G codes type A )

Manual supplied with
CMZ CNC LATHES
Models
(for all machines)

The basic preventive information contained in the manual should be observed in order to
ensure a safe operation of the machine. The operator should thoroughly read this manual
before operating the machine.
Keep this manual at hand reach in a safe location.

Issue 07.2004
Valid for
TL-15 from machine 368
TL-20 from machine 368
TL-25 from machine 368
TB-46 from machine 123
TB-67 from machine 123
TBI520 from machine 556

The machine includes more functions that those described in this
manual. However, the purchaser will have not the right of
demanding any of these additional functions at the time the
machine is supplied or when serviced by our After-sales Service.
CMZ reserves the right of making technical changes without
previous notice.
No part of this manual may be transmitted or copied, in any form or
by any means, without the previous written permission of CMZ.
Infringers will be prosecuted and claims for damages will be
lodged. Al rights reserved, particularly in case of Patent or Utility
Model.
© C.M.Z. , S.A. 2004 All Rights Reserved

PROGRAMMING MANUAL -3-

MEANING OF SYMBOLS
Several symbols are used to indicate the various types of warning or advise.
The operator must know the meaning of these symbols and carefully read the instructions
enclosed in order to ensure a safe operation of the machine.

<Symbols related to warning messages>
The instructions provided are classified into three categories: DANGER, WARNING and
CAUTION
The following symbols are used to indicate the hazard level:

Indicates an imminent hazard that, if not prevented, will be cause
of death or serious injures.
The instructions contained in DANGER boxes must be strictly
observed.
Indicates a potentially hazardous situation that, if not prevented,
could be cause of death or serious injures.
The instructions contained in WARNING boxes must be strictly
observed.
Indicates a potentially hazardous situation that, if not prevented, could
be cause of little or moderate damages to the machine.
The instructions next to CAUTION symbol must be strictly observed.

<Other Symbols>
COMMAND

The format identified by this symbol provides information on programming.

Indicates those aspects that should be considered.

Indicates the manual or page number to which you should be referred to find
further information on the topic in question.
Provides guidelines on the topic being described.

EXAMPLE

Provides an example for a given procedure.

PROGRAMMING MANUAL -4-

The format identified by this symbol provides information on programming. ............................................ 3
Indicates those aspects that should be considered. ................................................................................ 3
Indicates the manual or page number to which you should be referred to find further information on the
topic in question........................................................................................................................................ 3
Provides guidelines on the topic being described..................................................................................... 3
Provides an example for a given procedure............................................................................................. 3
1. BASIC CONCEPTS............................................................................................................................. 24
Refer to operation manual for further information on this subject, chapter B, point 3: SELECTING THE
COORDINATE SYSTEM......................................................................................................................... 24
If the machine is provided with a subhead, C1 would be for the main head and C2 for the subhead.....25
Cutting speed formula:........................................................................................................................... 25
Vc= Cutting speed.................................................................................................................................. 25
D= Part standard diameter..................................................................................................................... 25
n= Rpm limit........................................................................................................................................... 25
As you can see, two variants are available “,C” and “,A” with a leading comma to differentiate them from
C- and A-axis........................................................................................................................................... 25
New correction values must be entered when the tool is moved because of a hit.................................. 26
Refer to operation manual for further information on this subject, chapter B, point 4: OPERATION
PROCEDURE FOR MANUAL TOOL PRESETTER INTEGRATED IN THE MACHINE.......................... 26
When a tool is placed on the subhead (the case may be in which double toolholders are used for the
head and the subhead) keep in mind that correction values are ? 21, that is, for position 1 the correction
value will be 21, for position 2, 22, and so on.......................................................................................... 26
It can be also placed in other location, even though it is advised not to do it, as following up and verifying
the program would much more difficult and you should continuously calculate the difference between this
position and workpiece end..................................................................................................................... 26
We advise you to enter workpiece zero at the beginning of the program. .............................................. 26
How preparing the machine for machining operations with transfer:...................................................... 27
1st Determine workpiece zero and carry out the 1st machining stage.................................................... 27
2nd Stop the machine and verify the dimension before doing the transfer............................................. 27
3nd Do the transfer and place the subhead in working position.............................................................. 27

PROGRAMMING MANUAL -5-

4nd Stop the machine and determine workpiece zero before performing the 2nd machining stage. ......27
In this manual we will always refer to codes G type A. Refer to Fanuc programming manual for further
information on G codes........................................................................................................................... 29
Comment:............................................................................................................................................... 29
These are notes included in the program............................................................................................... 29
These notes are totally optional, and it is up to the programmer to enter them or not............................ 29
These notes will be always placed in brackets () in order to prevent the program reading them. ...........29
T101 29
Here is shown that the tool to be used is in position 1 and a correction value of 01 is applied...............29
T0101 could be also entered, as the four mandatory characters are present, however, the first zero is
optional.................................................................................................................................................... 29
Head rotation direction:.......................................................................................................................... 29
M3 head rotation direction...................................................................................................................... 29
M4 head rotation direction reverse or clockwise..................................................................................... 29
M4 M200 M8.......................................................................................................................................... 29
As seen in this example, up to 3 M codes can be programmed on each line......................................... 29
It is always advisable to switch chip conveyor and coolant on at the start of the program, excepting for
special cases........................................................................................................................................... 29
G0 X150 Z150........................................................................................................................................ 29
Note that tool retraction in this example is to 150 mm on X+ and 150 mm on Z+ from workpiece zero,
and not from chuck face, as no order for changing the position is given to workpiece zero, which in this
example is maintained in the previous position....................................................................................... 29
Line number (N10, N20...)...................................................................................................................... 29
Line numbers are optional, and can be either entered or not.................................................................. 29
It is advisable to enter line numbers with a margin, such as 10, 20 …, as you can then enter
intermediate operations without requiring changing all line numbers (10, 12, 13, 20...)........................... 29
G96 G99 S200 F.25............................................................................................................................... 29
As you can see, G codes are first placed and then S and F codes. Codes can be also entered in the
following manner: G96 S200 G99 F.25................................................................................................... 29
Entering codes such as G96 and G50 in the same line is not permitted................................................. 29
In this example you can see that the first pass (N10 to N50) is carried out letting part of the machining

PROGRAMMING MANUAL -6-

operation for de second pass (N60 to N120)........................................................................................... 30
You can also see that for taper turning entering the start point and the end point will not be necessary,
and the angle between these two points will be machined...................................................................... 30
In this example the part would have a ø35 hole...................................................................................... 31
In this example we consider that the part is rough machined................................................................. 32
As seen in this example, G2 is used to machine radii in clockwise direction and G3 in counterclockwise
direction................................................................................................................................................... 32
You can also see that G2 or G3 is first entered, then the end point, and finally the radius,.................... 32
As you can see, for the interpolation, you must know the point from which this interpolation will take
place in order to change radius direction (in this example on point X69.282 Z-60).................................. 33
In this example, slots of de ø65, ø71 and ø69 are to be machined. For this, tool T5 will be used. .........34
The references are: U for X-axis (U-command also on ø to).................................................................. 34
W for the Y-axis..................................................................................................................................... 34
H for the C-axis..................................................................................................................................... 34
Time delays are entered each time a slot is machined in order to stop the tool for a given time and then
properly complete the machining operation............................................................................................. 34
To go from M3 to M4, first enter M5 to stop the head............................................................................. 35
2. G FUNCTIONS................................................................................................................................... 36
This section describes G codes more commonly used. Refer to CNC unit manual supplied by the
manufacturer for G codes not included in this section............................................................................. 36
1- More than one G code may be programmed in a block, provided they are from different groups. .....36
2.- If more than one G code in a group is programmed in a block, only the last programmed G code will
be executed............................................................................................................................................. 36
3.- If a G code not specified in the list of G codes or a G code related to a function not available in the
machine is programmed, alarm message no. 010 will be displayed........................................................ 36
4.- G codes marked with % are activated by default when CNC is started or RESET key

pressed. 36

*1: Standard machines with automatic tailstock (T). ............................................................................... 37
*2: Standard for machines with powered tool......................................................................................... 37
*3: Optional for machines with sub-head (S).......................................................................................... 37
*4: Standard for machines with sub-head (S)......................................................................................... 37
*5: Optional for machines with powered tool........................................................................................... 37

PROGRAMMING MANUAL -7-

3. M FUNCTIONS................................................................................................................................... 40
For M codes not included in this manual, refer to CMZ. In some machine models, other M codes for
functions different to those described herein may be availbale................................................................ 40
4. THREADING....................................................................................................................................... 45
The outside thread area will be turned to a diameter (- 0.1 mm the metric diameter) in order to prevent
that thread tips can result in sharp edges................................................................................................ 46
G32 for threading operations, always operate at fixed rpm (G97).......................................................... 46
When retapping threads, do not release the workpiece, do not change the speed and do not change the
start point................................................................................................................................................ 46
5. CONTROL FIXED CYCLES................................................................................................................ 47
You can find here a brief explanation of machining cycles. For a detailed description, refer to section 13
of FANUC manual, part 1/2..................................................................................................................... 47
At the end of each cycle sequence the machine is always positioned in the position at which this cycle
sequence was started. The tool will be commonly located in the position used for rough machining. .....47
The profile allows changing X and Z direction........................................................................................ 47
At the end of each cycle sequence the machine is always positioned in the position at which this cycle
sequence was started.............................................................................................................................. 47
The positioning allows changing X- and Z-axis direction........................................................................ 47
If the block G71 U3 R1 is entered for the first time, it will be stored in the parameter U=P5132 and
R=P5133 and will be kept until changed in either the program or the parameter..................................... 47
Same as the above one, excepting for the profile................................................................................... 48
IMPORTANT: Roughing cycles are without tool radius compensation. Because of this, higher
allowances will be specified for X and Z depending on tool radius.......................................................... 49
6. EXAMPLES OF FIXED CYCLES........................................................................................................ 51
For retraction at the start, the end of program will be replaced by this end of program; with cycle G83
the control retracts the drill to the start point (X0 Z3) every time, thus the retraction (R05) is not entered.
52
Groove width or groove end point can be defined with a W code in this example (W27, that is, 30 – 3 of
tool), if tool is positioned on the right-hand would be (W-27). For either Z or W, tool width must be
subtracted............................................................................................................................................... 53
It must be kept in mind that in all cases when pitch is multiplied by the revolutions the result must be ?
4000. Pitch x R.P.M. .  4000.................................................................................................................. 55

PROGRAMMING MANUAL -8-

7. PROGRAMMING SIMPLIFICATION FUNCTIONS............................................................................. 58
Command and tool displacement tables are included in paragraph 13.6 of Fanuc Manual, part 1/2......58
In theses cases, considering tool direction is most important................................................................. 58
The easier procedure is drawing a quadrant on the drawing and locate the degrees as shown on the
above diagram......................................................................................................................................... 58
Finishing on (P3):................................................................................................................................... 60
N140 X200 C2;....................................................................................................................................... 60
N150 Z-102 (it is not known if right or left);............................................................................................. 60
You can program two angles with 2 radii or bevels as a maximum. ....................................................... 60
For further information on this subject, refer to section 14 on Fanuc manual, part 1/2........................... 60
All cycles ends where they are started and, because of this, finishing positioning is done above the
workpiece................................................................................................................................................ 66
For control units with capability for machining profiles with X-axis direction reversal, the first block for
defining the profile must state the movement of the two axes or include “U0” or “W0”. ........................... 68
Roughing cycles are without tool radius compensation. Because of this, higher allowances will be
specified for X and Z depending on tool radius........................................................................................ 68
8. FIXED CYCLES BY CMZ.................................................................................................................... 76
G38 can be only programmed on machines equipped with sub-head (S).............................................. 76
G38 B (J)_K_F_Q_;................................................................................................................................ 76
- G38 Workpiece push checking command............................................................................................ 76
- B Absolute command........................................................................................................................... 76
This is a B-axis coordinate value for the working position at which the workpiece will be transferred from
the head to the sub-head......................................................................................................................... 76
- F Advance (mm/min)............................................................................................................................ 76
This is the advance speed for workpiece transfer operation................................................................... 76
- Q Transfer position tolerance............................................................................................................... 76
After the workpiece is positioned on B+Q as a result of transfer operation, the program will be advanced
to the following block............................................................................................................................... 76
1- If B-axis position after retracted from detected transfer position is out of the specified tolerance
“B+Q”, an alarm message will be displayed............................................................................................ 76
3011 CYCLE NOT COMPLETED........................................................................................................... 76

PROGRAMMING MANUAL -9-

and the machine will be stopped............................................................................................................ 76
2- If Q value is omitted, the tolerance for workpiece position will be 1 mm. ............................................ 76
3- The approach point specified before G38 must be a point located at a distance of 1 mm from the
sub-head chuck....................................................................................................................................... 76
4- It is assumed that all coordinate values for B-axis are negative......................................................... 76
5- If any cycle argument is erroneous, the following alarm message will be displayed: ......................... 76
3012 ILLEGAL COMMAND.................................................................................................................... 76
Machining program................................................................................................................................. 77
G97 S1000 M03; Main head rotates at 1000 min-1................................................................................ 77
M33; Speed synchronisation.................................................................................................................. 77
M211; Open sub-head chuck jaws......................................................................................................... 77
G0 B-_; Sub-head moved to B position (approach point) (machine co-ordinate system) (First approach)
77
G98 G01 B-_F1000; Sub-head approached to workpiece at 1000 mm/min-1 (Second approach).........77
G38 B_F_Q_; Workpiece push detection............................................................................................... 77
Includes workpiece clamping operation on sub-head............................................................................. 77
G99; Advance per revolution.................................................................................................................. 77
M36; Speed synchronisation disabled.................................................................................................... 77
G28 B0; B-axis retracted to reference point........................................................................................... 77
Advance the tailstock to 10 mm on G0. From this position, the tailstock must be advanced on G1 until
reaching the torque limit with F700mm/min............................................................................................. 79
If S value is omitted, the default advance value on clamping will be: ..................................................... 80
200 mm/min........................................................................................................................................... 80
If D value is omitted, the default retraction value will be:........................................................................ 80
1500 mm/min......................................................................................................................................... 80
The tailstock is advanced to the B-position (-425.8+5=-420.8mm) on G0, as K is 5 and B is –425.8.
From this position, the tailstock is advanced on G1 until reaching the torque, with F700mm/min, as S is
700. 82
After executing the part-clamping-movement, the new T code will be executed.................................... 82
If the B-axis final position is less or equal to “B” (in the example, -425.8mm), the alarm 3011 PART NOT

PROGRAMMING MANUAL -10-

CLAMPED will appear............................................................................................................................. 82
Commands G384 and G380 can be only used on machines equipped with powered tool..................... 83
< Rigid threading cycle on front end >.................................................................................................... 83
G384 X_C_Z_........................................................................................................................................ 83
H_R_F_S_D_M_E_Q_A_T2(T3);........................................................................................................... 83
< Rigid threading cycle on a side >......................................................................................................... 83
G384 X_C_Z_........................................................................................................................................ 83
H_R_F_S_D_M_E_Q_A_T1;................................................................................................................. 83
G380;83
- G384 Enables a rigid threading cycle................................................................................................... 83
- G380 Disables a rigid threading cycle.................................................................................................. 83
- X,Z,C Absolute command for positioning the tool in front of hole centre.< Rigid threading on front end
>

83

- R Used to set R point position (incremental value)............................................................................... 83
- H Specifies the position of hole bottom on X- or Z-axis from point R (incremental value) .................... 83
- F Used to set thread pitch (mm)........................................................................................................... 83
- S Used to set tool lead-in speed (min-1).............................................................................................. 83
- D Used to set tool lead-out speed (min-1)............................................................................................ 83
- A Specifies the command for t code, for selecting a new tool.............................................................. 83
- M Used to activate head brake............................................................................................................. 83
M50 Brake of head or head 1................................................................................................................. 83
M250 Brake of head 2............................................................................................................................ 83
- T Used to set threading direction.......................................................................................................... 83
T1 Direction according to X-axis (threaded radial).................................................................................. 83
T2 Direction according to Z-axis (threaded axial <head 1>)................................................................... 83
T3 Direction according to Z-axis (threaded axial <head 2>)................................................................... 83
- Transmission ratio powered tool holder................................................................................................ 83
E Tool holder input speed....................................................................................................................... 83
Q Tool holder output speed.................................................................................................................... 83

PROGRAMMING MANUAL -11-

1- For a threading cycle, axis and head override will be set to 100%..................................................... 84
2- Dry Run function is not available when a threading cycle is being executed...................................... 84
3- Ensure that powered tool and head are stopped prior to executing a threading cycle........................ 84
4- As axes and tool are synchonised, using a floating tap will not be required....................................... 84
5- Powered tool speed will be limited when using a rigid threading cycle............................................... 84
For subsequent calls, only a single coordinate value is possible. X or Z or C......................................... 84
7- G384 function is programmed in all blocks requiring a rigid threading cycle. H, R, F, S, D, M, Q, E, A
and T values must not be entered in the second block in which a rigid threading cycle is programmed, as
well as in all subsequent blocks. Only the position at which a threading operation is to be carried out
must be entered. .................................................................................................................................... 84
8- H argument is the distance from R point to hole bottom..................................................................... 84
9- Entering the number of repeats for a rigid threading cycle is not permitted........................................ 84
10- A rigid threading cycle enabled with G384 must be disabled with G380........................................... 84
If another fixed cycle is entered without previously disabling a rigid threading cycle, an alarm message
(No. 3011) will be displayed. Indexing the turret with a T command during a rigid threading cycle is not
permitted................................................................................................................................................. 84
If another fixed cycle is specified without previously cancelling the rigid threading cycle, a collision
between tool and workpiece may occur................................................................................................... 84
11- During a rigid threading cycle, turret indexing by means of command T is carried out when starting
the cycle and before positioning the axes................................................................................................ 84
12- If no D value is specified, tool lead-in and lead-out speed will be that specified for S....................... 84
13- If neither M50 nor M250 is specified, there will be no head braking................................................. 84
14- T3 value must be only specified for machins equipped with a sub-head (S). This value must not be
used to perform a front threading operation on a workpiece located on the sub-head............................ 84
15- Commnad M250 will be only valid if a T3 value is specified............................................................. 84
16- If any cycle argument is erroneous, the following alarm message will be displayed:........................ 84
Power tool is stopped............................................................................................................................. 85
When moving from initial point to R point, powered tool rotation is stopped........................................... 85
G00 X200.0 Z100.0 M05; Powered tool is stopped................................................................................ 86
M81; C-axis is disabled.......................................................................................................................... 86
G99; Advance per revolution.................................................................................................................. 86

PROGRAMMING MANUAL -12-

Commands G384 and G380 can be only used on machines equipped with powered tool..................... 88
< Rigid threading cycle on front end >.................................................................................................... 88
G384 X_C_Z_........................................................................................................................................ 88
H_R_F_S_D_M_E_Q_A_T2(T3);........................................................................................................... 88
< Rigid threading cycle on a side >......................................................................................................... 88
G384 X_C_Z_........................................................................................................................................ 88
H_R_F_S_D_M_E_Q_A_T1;................................................................................................................. 88
G380;88
- G384 Enables a rigid threading cycle................................................................................................... 88
- G380 Disables a rigid threading cycle.................................................................................................. 88
- X,Z,C Absolute command for positioning the tool in front of hole centre.< Rigid threading on front end
>

88

- R Used to set R point position (incremental value)............................................................................... 88
- H Specifies the position of hole bottom on X- or Z-axis from point R (incremental value) .................... 88
- F Used to set thread pitch (mm)........................................................................................................... 88
- S Used to set tool lead-in speed (min-1).............................................................................................. 88
- D Used to set tool lead-out speed (min-1)............................................................................................ 88
- A Specifies the command for t code, for selecting a new tool.............................................................. 88
- M Used to activate head brake............................................................................................................. 88
M50 Brake of head or head 1................................................................................................................. 88
M250 Brake of head 2............................................................................................................................ 88
- T Used to set threading direction.......................................................................................................... 88
T1 Direction according to X-axis (threaded radial).................................................................................. 88
T2 Direction according to Z-axis (threaded axial <head 1>)................................................................... 88
T3 Direction according to Z-axis (threaded axial <head 2>)................................................................... 88
- Transmission ratio powered tool holder................................................................................................ 88
E Tool holder input speed....................................................................................................................... 88
Q Tool holder output speed.................................................................................................................... 88
1- For a threading cycle, axis and head override will be set to 100%..................................................... 89

PROGRAMMING MANUAL -13-

2- Dry Run function is not available when a threading cycle is being executed...................................... 89
3- Ensure that powered tool and head are stopped prior to executing a threading cycle........................ 89
4- As axes and tool are synchonised, using a floating tap will not be required....................................... 89
5- Powered tool speed will be limited when using a rigid threading cycle............................................... 89
For subsequent calls, only a single coordinate value is possible. X or Z or C......................................... 89
7- G384 function is programmed in all blocks requiring a rigid threading cycle. H, R, F, S, D, M, Q, E, A
and T values must not be entered in the second block in which a rigid threading cycle is programmed, as
well as in all subsequent blocks. Only the position at which a threading operation is to be carried out
must be entered. .................................................................................................................................... 89
8- H argument is the distance from R point to hole bottom..................................................................... 89
9- Entering the number of repeats for a rigid threading cycle is not permitted........................................ 89
10- A rigid threading cycle enabled with G384 must be disabled with G380........................................... 89
If another fixed cycle is entered without previously disabling a rigid threading cycle, an alarm message
(No. 3011) will be displayed. Indexing the turret with a T command during a rigid threading cycle is not
permitted................................................................................................................................................. 89
If another fixed cycle is specified without previously cancelling the rigid threading cycle, a collision
between tool and workpiece may occur................................................................................................... 89
11- During a rigid threading cycle, turret indexing by means of command T is carried out when starting
the cycle and before positioning the axes................................................................................................ 89
12- If no D value is specified, tool lead-in and lead-out speed will be that specified for S....................... 89
13- If neither M50 nor M250 is specified, there will be no head braking................................................. 89
14- T3 value must be only specified for machins equipped with a sub-head (S). This value must not be
used to perform a front threading operation on a workpiece located on the sub-head............................ 89
15- Commnad M250 will be only valid if a T3 value is specified............................................................. 89
16- If any cycle argument is erroneous, the following alarm message will be displayed:........................ 89
Power tool is stopped............................................................................................................................. 90
When moving from initial point to R point, powered tool rotation is stopped........................................... 90
G00 X200.0 Z100.0 M05; Powered tool is stopped................................................................................ 91
M81; C-axis is disabled.......................................................................................................................... 91
G99 (G95); Advance per revolution........................................................................................................ 91
The G100 command can be used only with the programmable tailstock specification machine. ............91

PROGRAMMING MANUAL -14-

G100 Z_ or G100 I1;.............................................................................................................................. 91
G100 …. Calls the tailstock connect joint mode..................................................................................... 91
Z ……… Specifies the distance between the chuck face and the tailstock. ............................................ 91
I1 ……… Specifies moving the tailstock to the parking position............................................................. 91
1/ Specify the G100 command independently in a block without other commands................................ 91
2/ Specify the coordinate value of the tailstock positioning point (Z) in mm. ........................................... 91
3/ For address Z, specify a numeric value with a decimal point.............................................................. 91
4/ In order to get the tailstock out from the parking position the G100Z_ command should be
commanded............................................................................................................................................ 91
To execute the G100 command, the following conditions must be satisfied:.......................................... 91
The main spindle or the rotary tool spindle is stopped............................................................................ 91
The turret head index has completed..................................................................................................... 91
The tailstock spindle is in the IN position................................................................................................ 91
During setup operation, it is recommended to record the position(s) where the tailstock should be
positioned and the position where the tailstock should be returned after the completion of machining.
The coordinate values must be specified in the machine coordinate system. ......................................... 91
The G101 command can be used only with the programmable tailstock specification machine. ............93
G101;93
G101 …. Calls the tailstock connect joint mode..................................................................................... 93
1/ Specify the G101 command independently in a block without other commands................................ 93
To execute the G101 command, the following conditions must be satisfied:.......................................... 93
The main spindle or the rotary tool spindle is stopped............................................................................ 93
The turret head index has completed..................................................................................................... 93
The tailstock spindle is in the IN position................................................................................................ 93
When programing G101 to get out the tailstock from park position, the joint hole doesn’t change and the
tailstock is coupled to the 2nd hole.......................................................................................................... 93
During setup operation, it is recommended to record the position(s) where the tailstock should be
positioned and the position where the tailstock should be returned after the completion of machining.
The coordinate values must be specified in the machine coordinate system. ......................................... 93
9. M functions made by CMZ................................................................................................................... 95

PROGRAMMING MANUAL -15-

U/2 distance must be greater than angular runout length ( r ). Refer to bottom left figure. ..................... 95
95
M23; ............ Used for angular runout.................................................................................................... 95
M24; ............ Used for straight runout (disables angular runout)............................................................ 95
As shown in the figure, r distance is programmed by means of parameter 5130. Runout angle will be
45º. 95
M33, M34 and M36 commands are only used on machines equipped with a sub-head (S). .................. 96
M33; ............ Speed synchronisation...................................................................................................... 96
M34; ............ Phase and speed synchronisation.................................................................................... 96
M36; ............ Synchronisation mode disabled........................................................................................ 96
1- For transferring a workpiece from main head to sub-head, head and sub-head speed must be
synchronised by means of M33 command. If the workpiece is transferred without activating the
synchronisation mode, scratching of workpiece could result................................................................... 96
2- For transferring an hexagonal bar, head and sub-head phase and speed must be synchronised by
means of M34 command, as otherwise the transfer operation will not be possible................................. 96
3- M36 function should be only programmed after completing a cutting cycle or when chucks on main
head and sub-head are open.................................................................................................................. 96
4- If a M34 function is programmed with sub-head jaws closed, alarm message FM 102 will be
displayed................................................................................................................................................. 96
5- M5 function must not be programmed when phase and/or speed synchronisation mode is activated.
M5 function will disable the synchronisation mode.................................................................................. 96
M34 function can de also used for round parts, but considering that phase (and speed) synchronisation
time is longer and speed synchronisation time, using M33 function is recommended when machining
round parts.............................................................................................................................................. 96
Machining program................................................................................................................................. 97
G97 S1000 M03; Main head rotates at 1000 min-1................................................................................ 97
M34; Phase and speed synchronisation................................................................................................. 97
After synchronising the phases, head and sub-head speed is synchronised to 1000 min-1................... 97
M211; Sub-head jaws are opened.......................................................................................................... 97
During the synchronisation, heads can be rotated with jaws open.......................................................... 97
G53 B-_; Sub-head is moved to limit point on B-axis (machine co-ordinates) ........................................ 97

PROGRAMMING MANUAL -16-

G98 G01 B-_F1000; Sub-head is approached to workpiece at a speed of 1000 mm/min ...................... 97
G38 J_K_F_Q_; Workpiece push is detected........................................................................................ 97
Includes clamping of workpiece on sub-head......................................................................................... 97
G99; Advance per revolution.................................................................................................................. 97
Machining program)............................................................................................................................... 97
M36; Synchronisation mode is disabled................................................................................................. 97
Sub-head is stopped while main head continues rotating at programmed speed................................... 97
G28 B0; Sub-head is returned to reference point on B-axis................................................................... 97
Machining program................................................................................................................................. 98
G97 S1000 M03; Main head rotates at 1000 min-1................................................................................ 98
M33; Speed synchronisation.................................................................................................................. 98
Head and sub-head speed is synchronised to 1000 min-1..................................................................... 98
M211; Sub-head jaws are opened.......................................................................................................... 98
During the synchronisation, heads can rotate with jaws open................................................................ 98
G53 B-_; Sub-head is moved to limit point in B-axis (machine co-ordinates)......................................... 98
G98 G01 B-_F1000; Sub-head is approached to workpiece at 1000 mm/min ........................................ 98
G38 J_K_F_Q_; Workpiece push is detected........................................................................................ 98
Includes clamping of workpiece on sub-head......................................................................................... 98
G99; Advance per revolution.................................................................................................................. 98
Machining program................................................................................................................................. 98
M36; Synchronisation mode is disabled................................................................................................. 98
Sub-head is stopped while main head continues rotating at programmed speed................................... 98
G28 B0; Sub-head is returned to reference point on B-axis................................................................... 98
M310; Automatic selection of main spindle windings.............................................................................. 99
M311; Star-winding selection in main spindle........................................................................................ 99
M312; Delta-winding selection in main spindle...................................................................................... 99
M320; Automatic selection of windongs in subspindle............................................................................ 99
M321; Star-winding selection in subspindle........................................................................................... 99
M322; Delta-winding selection in subspindle......................................................................................... 99

PROGRAMMING MANUAL -17-

1.- In machines without subspindle no execution of M320, M321 or M322 is executed.......................... 99
M40; ............ Detection of cut workpiece................................................................................................ 99
1.- M40 function can be only used on machines equipped with a sub-head (S)..................................... 99
2.- If the cutting cycle is not completed after executing a M40 function, the two heads are stopped and
alarm message FM41 (Cutting cycle not completed) displayed............................................................... 99
3.- If a M40 function is executed with head synchronisation mode activated, the head with the rotation is
initiated (M3, M4, M203, M204) will rotate at programmed speed. The other head will be stopped.........99
4.- Even though a M40 function disables head synchronisation, the operation synchronisation mode is
not disabled. Always enter a M36 function after entering a M40 function in the program. ....................... 99
Machining program............................................................................................................................... 100
G97 S1000 M03; Main head rotates at 1000 min-1.............................................................................. 100
M33; Speed synchronised in both heads.............................................................................................. 100
Workpiece transfer............................................................................................................................... 100
G99 G00 X42.0 M08; Advance per revolution...................................................................................... 100
G01 X-06 F0.08; Cutting cycle. Workpiece cut to X-0.6 at a feed speed of 0.08 mm/sec. ................... 100
M40; Detection of cut workpiece........................................................................................................... 100
Main head rotates at 1000 min-1 and sub-head is stopped.................................................................. 100
M36; Head synchronisation mode is disabled....................................................................................... 100
G28 B0; Sub-head is returned to reference point on B-axis................................................................. 100
M73; ............ Workpiece COLLECTION............................................................................................... 101
(Workpiece collector IN)..................................................................................................................... 101
M74; ............ Workpiece EJECTION.................................................................................................... 101
(Workpiece collector OUT)................................................................................................................. 101
1.- On machines equipped with a sub-head (S), don not enter a M73 function in the program if there is
any risk of collision with sub-head body................................................................................................. 101
2.- On machines equipped with a sub-head (S), B-axis displacement is not permitted when workpiece
collector is in collection position............................................................................................................. 101
Machining program............................................................................................................................... 102
M05: Sub-head is stopped.................................................................................................................... 102
G53 B_; Sub-head is moved to the position at which the workpiece is collected by workpiece collector.

PROGRAMMING MANUAL -18-

102
Workpiece collector operates independently from turret position......................................................... 102
B-axis co-ordinate value will be the position at which the workpiece is released from the sub-head
without causing any interference with workpiece collector, turret, etc.................................................... 102
M73; Workpiece collector is moved to collection position..................................................................... 102
M211; Workpiece released from sub-head........................................................................................... 102
G04 U_; Time delay.............................................................................................................................. 102
G28 B0; B-axis is moved to reference point......................................................................................... 102
M74; Workpiece collector is moved to ejection position....................................................................... 102
M254; Sub-head jaws are blown with air.............................................................................................. 102
G04 U_; Time delay.............................................................................................................................. 102
M259; Jaw blowing is deactivated........................................................................................................ 102
M432; .............Workpiece collection cycle............................................................................................ 105
1.- Commands M210 and M211 (open and close sub-head jaws respectively) cannot be executed when
a workpiece collection cycle is being executed...................................................................................... 105
2.- The following operations, if programmed when a workpiece collection cycle is activated, will be
executed at the end of workpiece collection cycle:................................................................................ 105
- B-axis displacement........................................................................................................................... 105
- Head phase synchronisation (M34).................................................................................................... 105
- Head speed synchronisation (M33).................................................................................................... 105
- Manual door opening (M30)............................................................................................................... 105
- Automatic door opening (M70)........................................................................................................... 105
- Sub-head rotation (M203/M204)......................................................................................................... 105
- Sub-head orientation (M219).............................................................................................................. 105
- Sub-head jaws blowing (M254).......................................................................................................... 105
3.- Programming a M432 will not be permitted in there is any interference of B-axis with workpiece
collector................................................................................................................................................. 105
4.- If a M432 is programmed in a block together with a displacement of B-axis, workpiece collection
cycle will be executed after the required B-axis displacement is completed.......................................... 105
Machining program............................................................................................................................... 106

PROGRAMMING MANUAL -19-

M05: Sub-head is stopped.................................................................................................................... 106
G53 B_; Sub-head is moved to the position at which workpiece collector collects the workpiece. .......106
Workpiece collector operates independently from turret position......................................................... 106
B-axis co-ordinate value will be the position on B-axis at which the workpiece is released from the subhead, without causing any interference with workpiece collector, turret, etc.......................................... 106
M432; Workpiece collection cycle........................................................................................................ 106
The sub-head is stopped...................................................................................................................... 106
M11; Open jaws on main head............................................................................................................. 106
G04 U_; Time delay to allow properly opening main head jaws............................................................ 106
M62; Bar feed (push)............................................................................................................................ 106
M10; Clamp workpiece on main head.................................................................................................. 106
G04 U_; Time delay to allow properly clamping a new workpiece on main head.................................. 106
(Machining operation on main head).................................................................................................... 106
M454; .............Bar unloader, formards command................................................................................ 106
M455; .............Bar unloader, backwards command............................................................................. 106
M472; .............Bar unloader, command for unloading start.................................................................. 106
M473; .............Bar unloader, command for end of unloading............................................................... 106
M200................................ Start chip conveyor..................................................................................... 107
M201................................ Stop chip conveyor...................................................................................... 107
If a rear chip conveyor is installed, M200 and M201 codes switch on and off cleaning fluid, respectively,
further to starting and stopping the chip conveyor................................................................................. 107
In this case, chip conveyor operation time entered on parameter screen does not affect cleaning fluid
pump operation..................................................................................................................................... 107
TBI 520 machines can be provided with a second coolant pump. This pump is started and stopped,
while on automatic mode, by means of codes M18 and M17, respectively. If a M9 code is programmed,
both coolant pumps are stopped........................................................................................................... 107
This pump is optional for TBI520 machines.......................................................................................... 107
A cleaning pump is always provided on TL machines equipped with rear chip conveyor or B-axis. .....108
Operation of cleaning pump will be only possible with machine door closed. ...................................... 108
This option is only available for TL machines....................................................................................... 108

PROGRAMMING MANUAL -20-

Through-coolant supply will be only activated with machine door closed.............................................. 108
The coolant gun is an option available for all machines........................................................................ 108
10. PROGRAMMING C-AXIS AND POWERED TOOL........................................................................ 109
Commands M80, M280, M81 and M281 can be only used on machines of M type Commands M280 and
M281 can be only used on machines of SM type. ................................................................................ 109
By programming command M80, M280 on automatic mode or MDI mode, head1 or head2 can be
indexed to the required angular position in order to drill holes on the circular contour of the workpiece or
on the end face...................................................................................................................................... 109
On mode M80 or M280, head rotation can be controlled synchronically with tool movement in order to
cut grooves or slots............................................................................................................................... 109
M80; ............. C-axis mode is activated on head1. .............................................................................. 110
M280; ........... C-axis mode is activated on head2................................................................................ 110
M81; ............. C-axis mode is deactivated on main head or on head1................................................. 110
M281; ........... C-axis mode is deactivated on head2............................................................................ 110
1- Stop the head (head1 and/or head2) by entering the command M05 (head1) or M205 (head2) before
entering commands M80, M280. If any of the last parameters is entered with head1 or head2 rotating,
the machine will be stopped and an alarm message (FM024) will be shown on the display..................110
2- Before entering command M81 or M281, the powered tool must be stopped by entering command
M05 or M85. If any of these commands is entered when the powered tool is rotating, the machine will be
stopped and the alarm message (FM025) will de shown on the display................................................ 110
3- For machines of SMC series, deactivating C-axis function will not be necessary when changing this
function from a head to the other head by means of M80 or M280........................................................ 110
4- For machines of SMC series, head1 or head2 will operate on C-axis mode when entering M80 or
M280 respectively. To deactivate C-axis function on either head, only enter command M81 or M281
respectively, in case of each head......................................................................................................... 110
5- For machines of SMC series, if machining operations are to be carried out with head2, C-axis must be
returned to its “zero reference point” after completing the machining operations with head1................110
Commands M480 and M481 can be only used on machines of SMC series........................................ 111
M480; ........... C-axis mode is activated on both heads, head1 and head2........................................... 111
M481; ........... C-axis mode is deactivated on both heads, head1 and head2....................................... 111
111
When C-axes on both heads are coupled, activating the hydraulic brake to lock head1 (M50) will only be

PROGRAMMING MANUAL -21-

permitted. Considering that this function is used to machine workpieces clamped on both heads, locking
both heads will not be required. ............................................................................................................ 111
1- Stop head, head1 or head2 by entering M05 (head1) and/or head2 by entering M205 before entering
command M480. If the last command in entered when the head1 or head2 is rotating, the machine will
be stopped and the alarm message (FM024) will be shown on the display........................................... 111
2- Before entering command M481 you will need to stop the powered tool by entering M05 or M85
command. If command M481 is programmed when the powered tool is running, the machine will be
stopped and the alarm message (FM025) will be shown on the display................................................ 111
3- For machines of SMC series, when a command M480 is entered both heads, head1 and head2 will
operate in C-axis mode. To rotate the heads, C-axis must be deactivated by means of M81 or M281
respectively, or by means of M481........................................................................................................ 111
Commands M380 and M381 are only used on machines of SMC series provided with SUPERCAP tool.
112
M380; ........... C-axis mode is activated by means SuperCap.............................................................. 112
M381; ........... C-axis mode is activated by means SuperCap.............................................................. 112
M303; ........... When SuperCap is used, activates C-axis for head1 after enabling C-axis mode by
means of M380...................................................................................................................................... 112
M304; ........... When SuperCap is used, activates C-axis for head2 after enabling C-axis mode by
means of M380...................................................................................................................................... 112
For machines of SMC series, chuck locking function is only valid for the head for which the last M
function is entered, and provided that more than one M303 (activation of C-axis for head1), M304
(activation of C-axis for head2), M50 (head brake for head1), or M250 (head brake for head2), is entered
in a single block. Therefore, the machining process must be carried out with the head corresponding to
the M code entered in the program. If the machining operation is carried out with the other head, the
powered tool will not be stopped, irrespective the jaws are open or not, so the workpiece could fall down
or be thrown away the chuck, causing personal injures or damages to the machine. ........................... 112
1- For machines of SMC series, head1 or head2 will operate in C-axis mode if command M303 or M304,
respectively, is entered in the program. To rotate head1 or head2, C-axis mode is disabled on head1
and head2 by entering the command M381.......................................................................................... 112
2- For machines of SMC series, after using main head, C-axis must be returned to zero position before
changing to the subhead, after using the main head............................................................................. 112
Numbers in brackets indicate the order in which holes are drilled........................................................ 113
Numbers in brackets indicate the order in which holes are drilled........................................................ 114
This operation will be performed in two passes.................................................................................... 116

PROGRAMMING MANUAL -22-

This tapping operation is only performed on machines equipped with powered tool............................ 120
This example describes a rigid tapping operation for three holes spaced 120º.................................... 120
The approach operation is only an example. The programmer is responsible for entering correct values.
121
This tapping operation is only performed on machines equipped with powered tool............................ 122
This example describes a rigid tapping operation for two holes spaced 180º....................................... 122
Milling radius compensation must be always used in this type of programs. ........................................ 123
In this case we are using a milling cutter of diameter 10...................................................................... 123
Therefore, on the correction table, enter Radius = 5 and Tool type = 9................................................ 123
Tool selection and approach to start point operations are omitted and they must be determined by the
programmer........................................................................................................................................... 124
Approach operation is omitted. The programmer is responsible for entering correct values. ...............125
11. FUNCTIONS TO SHORTEN CYCLE TIME..................................................................................... 126
Those functions which require to be executed that a function in the same block will be previously
executed must not be entered in the same block.................................................................................. 127
For instance, neither “M80 M83” nor “M81 M85” must be entered in the same block, as M83 and M85
require that M80 and M81 respectively will be previously executed....................................................... 127
Do not enter “M70 M30”, but “M30 M70” (cycle end and door opening)............................................... 127
12. OTHER PROGRAMMING EXAMPLES........................................................................................... 129
The approach operation is only an example. The programmer is responsible for entering correct values.
129
130
The approach operation is only an example. The programmer is responsible for entering correct values.
130
In this example the machining operations include facing, axial drilling and.......................................... 131
cutting plus cylindrical grooving. .......................................................................................................... 131
131
N270 G0 G40 X200 Z150 M30............................................................................................................. 131
In this case, all roughing cycles will not permit tool compensation. The approach operation is omitted, as
the programmer depending of tool used should determine it................................................................. 132
132

PROGRAMMING MANUAL -23-

1. BASIC CONCEPTS
1.1

Machine axes

Refer to operation manual for further information on this subject, chapter B,
point 3: SELECTING THE COORDINATE SYSTEM

1.1.1 X axis, Z axis

X+

Z-

Z+

B-

B+

XX-, Z- and B-axis and their respective positive and negative displacement directions are shown
on the above schematic diagram.
As you can see, when workpiece zero reference point is located on workpiece end (most
common case), the positive direction is outside the workpiece, while the negative direction is
on the workpiece area to be machined (inside the workpiece).
Commonly, you will operate in the quadrant defined by X+ and Z-.
The machine will enter only in X- area for facing operations.
You may also operate X+ Z+ quadrant when the workpiece is clamped on the subhead.

PROGRAMMING MANUAL -24-

1.1.2 C-axis
C-axis would be used to swivel the head in order to
position the workpiece for drilling operations using a
powered tool.

C-

C+

C+ is in clockwise direction and C- is counterclockwise
direction.
If the machine is provided with a
subhead, C1 would be for the main head
and C2 for the subhead.

1.1.3 Other axes that could be encountered when programming the
machine are
A: powered tool rotating axis.
B: displacement axis used to approach the subhead to main head or move it away.
F: feed axis (related to slides) to be programmed when in operation.
In millimetres x per revolution when the head is rotating (turning)
For example:
G99 F0.3
 this means “03 millimetres per revolution”.
In millimetres per minute when the head is stopped (MC).
For example:
G98 F80
 this means “80 millimetres per minute”
T: is turret rotation.
R: is radius programming.
S: are head revolutions (cutting speed) This letter is always related to heads.
G50 S1000  Rpm limit.
G97 S1000  fixed rpm (for tapping and drilling).
G96 S200
 cutting speed (m/min) for all turning operations.
Cutting speed formula:
Dn
Vc=
1000
n=

Vc1000

Vc= Cutting speed
D= Part standard diameter
n= Rpm limit.

D

,C: bevel programming.
,A: angle programming.
As you can see, two variants are available “,C” and “,A” with a leading comma
to differentiate them from C- and A-axis

PROGRAMMING MANUAL -25-

1.2

Tool offset
The correction value is the protruding length of tool end from the zero reference of turret disc.
The required correction values must be entered each time tool position is changed with respect
to the aforementioned position; if tool position is not changed, entering a correction value will
not be necessary as these values are stored in the memory.
New correction values must be entered when the tool is moved because of a hit

1.2.1 Entering correction values
There are two ways for entering tool correction values.
1st.) supplied with presetter.
For machines with presetter, place the presetter in position and preset the tool.

Refer to operation manual for further information on this subject, chapter B,
point 4: OPERATION PROCEDURE FOR MANUAL TOOL PRESETTER
INTEGRATED IN THE MACHINE

2nd.) supplied without presetter.
For machines without presetter, turn the workpiece and retract the tool without moving it out
the axis. Then measure the workpiece and enter the readings in the geometry table.
To enter a value, go to the geometry table (correction value), enter the required value and
press the intermediate key; by this way the control unit will calculate the correction value.
When a tool is placed on the subhead (the case may be in which double
toolholders are used for the head and the subhead) keep in mind that correction
values are ? 21, that is, for position 1 the correction value will be 21, for position
2, 22, and so on.

1.3

Workpiece zero reference point
Workpiece zero is the workpiece protruding length from main chuck face.
It can be also placed in other location, even though it is advised not to do it, as
following up and verifying the program would much more difficult and you should
continuously calculate the difference between this position and workpiece end.
We advise you to enter workpiece zero at the beginning of the program.

PROGRAMMING MANUAL -26-

<Standard for machines with sub-head>
In the following example we explain how a value of 80 is entered for the first stage (machining
the workpiece on the head), while a value of 460 is entered for the second stage (machining
the workpiece on the subhead).

Zero 1st phase
G10 P0 Z-80

Zero 2nd phase
G10 P0 Z-460

How preparing the machine for machining operations with transfer:
1st Determine workpiece zero and carry out the 1st machining stage.
2nd Stop the machine and verify the dimension before doing the transfer.
3nd Do the transfer and place the subhead in working position.
4nd Stop the machine and determine workpiece zero before performing the 2nd
machining stage.

PROGRAMMING MANUAL -27-

1.4

Facing
O0001;
N10 G10 P0 Z-103;
N20 T101 (FACING);
N30 G50 S2000 (LIMIT R.P.M.);
N40 G96 G99 S200 F.25 M4 M200 M8
(CUTTING CONDITIONS, CHIP
CONVEYOR AND COOLANT
ACTIVATION);
N50 G0 X45 Z0 (APROXIMATION)
N60 G1 X-2;
N70 G0 X150 Z150;
N80 M30;

BBD 210

Program number

Position the turret on
tool 1 with correction
value 01
Limit to
2000 r.p.m.

Data input

Workpiece zero -103
Comment

O0001;

Cutting speed
(Vc=200 m/min)

N10 G10 P0 Z-103;

Feed (mm/revolution)

N20 T101 (STARTING WITH FACING);

Chip conveyor
running

Entering the feed per
revolution

N30 G50 S2000 (LIMIT R.P.M.);

Entering head speed
in m/min

N40 G96 G99 S200 F.25 M4 M200 M8 CUTTING CONDITIONS,
CHIP CONVEYOR AND COOLANT ON;

Positioning the tool on
X45 Z0, that is, 5 mm
above the workpiece
Line number

End and rewinding
of program

N50 G0 X45 Z0 (APPROACH);
N60 G1 X-2;
N70 G0 X150 Z150;
N80 M30;

Coolant supply on
Head rotation in
clockwise direction
Facing up to X-2, that is,
crossing 2 mm below
the axis

Retraction at quick speed to X150
Z150, that is, at 150 mm on both
axes.

PROGRAMMING MANUAL -28-

In this manual we will always refer to codes G type A. Refer to Fanuc
programming manual for further information on G codes.

Comment:
These are notes included in the program.
These notes are totally optional, and it is up to the programmer to enter them or
not.
These notes will be always placed in brackets () in order to prevent the program
reading them.
T101
Here is shown that the tool to be used is in position 1 and a correction value of
01 is applied.
T0101 could be also entered, as the four mandatory characters are present,
however, the first zero is optional.
Head rotation direction:
M3 head rotation direction
M4 head rotation direction reverse or clockwise.
M4 M200 M8
As seen in this example, up to 3 M codes can be programmed on each line.
It is always advisable to switch chip conveyor and coolant on at the start of the
program, excepting for special cases.
G0 X150 Z150
Note that tool retraction in this example is to 150 mm on X+ and 150 mm on Z+
from workpiece zero, and not from chuck face, as no order for changing the
position is given to workpiece zero, which in this example is maintained in the
previous position.
Line number (N10, N20...)
Line numbers are optional, and can be either entered or not.
It is advisable to enter line numbers with a margin, such as 10, 20 …, as you
can then enter intermediate operations without requiring changing all line
numbers (10, 12, 13, 20...).
G96 G99 S200 F.25
As you can see, G codes are first placed and then S and F codes. Codes can be
also entered in the following manner: G96 S200 G99 F.25
Entering codes such as G96 and G50 in the same line is not permitted.

PROGRAMMING MANUAL -29-

1.5

Taper turning
BBD 210

Pass
Pass

O0002;
N10 G10 P0 Z-78;
N20 T101;
N30 G50 S1500;
N40 G96 G99 S200 F.25 M4 M8 M200;
N50 G0 X52.5 Z2;
N60 G1 Z-19.9;
N70 G0 X55 Z2;
N80 X45;
N90 G1 Z0;
N100 X52 Z-20 F.2;
N110 X61;
N120 G0 X200 Z200;
N130 M30;

Name of the program
Part-zero at –78
Tool chosing (pos. 01 and offset 01)
Spindle turning limit: 1500 rpm
Cutting speed (m/min), Feedrate (mm/rev),
clockwise sense, Coolant, Chip conveyor
Fast feedrate to point X52.5 Z2
Machine and go to Z-19.9 (First pass)
Fast feedrate to X55 Z2
Fast feedrate until the beginning of cone in X45 Z2
Machining feedrate to X45 Z0
Machine the cone to X52 Z-20 (Second pass)
Machine to X61 Z-20
Fast backwards to 200mm in both axes
End of programm and back to he beginning

In this example you can see that the first pass (N10 to N50) is carried out letting
part of the machining operation for de second pass (N60 to N120).
You can also see that for taper turning entering the start point and the end point
will not be necessary, and the angle between these two points will be machined.

PROGRAMMING MANUAL -30-

1.6

Inside turning:

BBD 210

O0003;
N10 G10 P0 Z-85;
N20 T606;
N30 G50 S2000;
N40 G96 G99 S180 F.2 M4 M8 M200;
N50 G0 X44 Z2;
N60 G1 Z0;
N70 X40 Z-2 F.15;
N80 Z-40 F.2;
N90 X35;
N100 G0 Z5;
N110 X200 Z100;
N120 M30;

Part zero at -85
Tool 06 offset 06
Turning speed limit: 2000 r.p.m.
Cutting speed =180 mm/rev, feedrate 0.2 mm/rev,
clockwise sense
Move Z2 axis to the height of the beve 2x45º
Move forwards machining to Z0
Machine the bevel with feedrate 0.15 mm/rev
Machine the inside at ø40 with federate 0.2 mm/rev
Face the inside until ø35
Fast feedrate to Z5
Move backwards to X200 Z100
End and back to de beginning

In this example the part would have a ø35 hole.

PROGRAMMING MANUAL -31-

1.7

Radii

BBD 210
G2

O0004;
N10 G10 P0 Z-110;
N20 T303;
N30 G50 S2500;
N40 G96 S220 G99 F.2 M4 M8 M200;
N50 G0 X30 Z2;
N60 G1 Z-22;
N70 G2 X40 Z-27 R5 (CLOCKWISE SENSE);
N80 G1 X55;
N90 G3 X80 Z-57 R80 (COUNTERCLOCKWISE);
N100 G1 Z-62;
N110 X86;
N120 G0 X150 Z150 M30;

G3

Machine to ø30 and Z-22
Radio 5 clockwise to X40 Z-27
Face to X55
Radio 80 counterclockwise to X80 Z-57
Machine to Z-60
Face to X86

In this example we consider that the part is rough machined.
As seen in this example, G2 is used to machine radii in clockwise direction and
G3 in counterclockwise direction.
You can also see that G2 or G3 is first entered, then the end point, and finally
the radius,

PROGRAMMING MANUAL -32-

1.8

Cylindrical interpolation
BBD 210

O0005;
N10 G10 P0 Z-165;
N20 T404;
N30 G50 S2000;
N40 G96 S200 G99 F.2 M4 M8 M200;
N50 G0 X69.282 Z2;
N60 G1 Z-20;
N70 G3 X69.282 Z-60 R40;
N80 G2 X69.282 Z-100 R40;
N90 G1 Z-105;
N100 G0 X150;
N110 Z10
N120 M30;

Fast feedrate to X69.292 Z2
Machining to Z-20
Machine at radio 40 until point X69.282
Z-60 counterclockwise sense
Machine at radio 40 until point X69.282
Z-100 clockwise
Machining to Z-105

As you can see, for the interpolation, you must know the point from which this
interpolation will take place in order to change radius direction (in this example
on point X69.282 Z-60).

PROGRAMMING MANUAL -33-

1.9

Incremental commands (U, W, H) only for FANUC
BBD 210

O0006;
N10 G10 P0 Z-96:
N20 T505;
N30 G96 G99 S120 F.1 M4 M8 M200;
N40 G0 X78 Z-20;
N50 G1 X65;
N60 G4 X1 (TEMPORIZACION 1 SEGUNDO);
N70 G0 X78;
N80 W-10 (INCREMENTAL);
N90 G1 U-7;
N100 G4 X1;
N110 G0 U7;
N120 W-15;
N130 G1 U-9;
N140 G4 X1;
N150 G0 U9;
N160 X200 Z200;
N170 M30;

Fast feedrate to X78 Z-20
Grooving to ø65
Timming (stop tool 1 sec X1=P1000)
Fast feedrate to X78
Increment –10 en el eje Z (W=Z)
Increment –7 en el eje X (U=X)
Timming
Fast feedrate 7 in axis X (U=X)
Increment –15 en eje Z (W=Z)
Groove until –9 in axis X (ø69)
Timming
Fast feedrate 9 in axis X (ø78)

In this example, slots of de ø65, ø71 and ø69 are to be machined. For this, tool
T5 will be used.
The references are:
U for X-axis (U-command also on ø to)
W for the Y-axis
H for the C-axis
Time delays are entered each time a slot is machined in order to stop the tool
for a given time and then properly complete the machining operation.

PROGRAMMING MANUAL -34-

1.10 Example for operation
BBD 210

Clockwise turning

Remove axes and stop spindle
Tool 2
Fixed turn. speeds, Count.clockwise
Remove axes and spindle stop
Tool 3
Clockwise turning

To go from M3 to M4, first enter M5 to stop the head.

Boring

Tool 1

Inside machining

O0007;
N10 G10 P0 Z-74;
N20 T101 (EXTERNAL);
N30 G50 S2500;
N40 G96 S220 G99 F.25 M4 M8 M200;
N50 G0 X35 Z0;
N60 G1 X-2;
N70 G0 X26 Z2;
N80 G1 Z0;
N90 X28 Z-1 F.2;
N100 Z-18 F.25;
N110 X32;
N120 G0 X150 Z200 M5;
N130 T202 (BROCA DE 15);
N140 G97 S600 G99 F.15 M3;
N150 G0 X0 Z3;
N160 G1 Z-47;
N170 G0 Z100 M5;
N180 T303 (INTERIOR);
N190 G96 S150 G99 F.25 M4;
N200 G0 X22 Z3;
N210 G1 Z0;
N220 X20 Z-1 F.15;
N230 Z-13 F.2;
N240 X15 Z-20 F.15;
N250 G0 Z5;
N260 X200 Z150 M30;

External machining

Tools:
T1= Outside and facing.
T2= ø15 twist drill.
T3= Inside.

PROGRAMMING MANUAL -35-

2. G FUNCTIONS
G functions used in machining programs are described in this section.
This section describes G codes more commonly used. Refer to CNC unit
manual supplied by the manufacturer for G codes not included in this section.

2.1

List of G codes
Also called preparatory functions, G codes consist of a G address followed by a numerical
value which defines a machining mode or an axis displacement within a program block. The
CNC unit will control the specified G code.
G codes are classified into two types:
Type

Description

Non-modal G code
(Group 00, excepting G10 and G11)

The G code is valid within the block in which it was
programmed

Modal G code
(Groups other than 00)

The G code will remain valid until another G code of
the same group is programmed.

For instance, G00 and G01 are modal G codes, as they pertain to a group other than 00.
G01 X_Z_;
X_;
Z_;
G00 X_Z_;

G01 is valid within this range

1- More than one G code may be programmed in a block, provided they are
from different groups.
2.- If more than one G code in a group is programmed in a block, only the last
programmed G code will be executed.
3.- If a G code not specified in the list of G codes or a G code related to a
function not available in the machine is programmed, alarm message no. 010
will be displayed.
4.- G codes marked with % are activated by default when CNC is started or
RESET key
pressed.

PROGRAMMING MANUAL -36-

2.1.1 TL, TB, TBI models
*1: Standard machines with automatic tailstock (T).
*2: Standard for machines with powered tool
*3: Optional for machines with sub-head (S).
*4: Standard for machines with sub-head (S).
*5: Optional for machines with powered tool.
) = Standard, + = Optional, x = Not available

G Code

%

%

%
%

Group

Function

Remarks

A

B

C

G00

G00

G00

Positioning (fast feedrate)

)

G01

G01

G01

Linear interpolation (machining feed)

)

G02

G02

G02

G03

G03

G03

G04

G04

G04

G07.1
(G107)

G07.1
(G107)

G07.1
(G107)

G10

G10

G10

G11

G11

G11

G12.1
(G112)
G13.1
(G113)

G12.1
(G112)
G13.1
(G113)

G12.1
(G112)
G13.1
(G113)

G17

G17

G17

G18

G18

G18

G19

G19

G19

G20

G20

G70

01

00

00

21

16

Circular clockqwise or helical
interpolation (clockwise)
Circular counterclockwise or helical
interpolation (counterclockwise)

)
)

Time delay

)

Cylindrical interpolation

x2

Programmable data input

)

Programmable data input disabled

)

Interpolation mode in polar coordinates

x2

Interpolation mode in polar coordinates
disabled

x2

Xp-Yp plane selection

)

Zp-Xp plane selection

)

Yp-Zp plane selection

)

Input in inches

+

Input in mm

+

06

%

G21

G21

G71

G22

G22

G22
09

G23

G23

G23

G27

G27

G27

G28

G28

G28
00

Verify traverse limit stored in the
memory. Function enabled
Verify traverse limit stored in the
memory. Function disabled

+
+

Go to reference point verification

)

Go to reference point

)

G30

G30

G30

Go to second, third and fourth reference
point

+

G31

G31

G31

Skip function

)

PROGRAMMING MANUAL -37-

G Code
A

B

C

G32

G33

G33

Group

Function

Remarks

Threading

)

01

%

%

%

G34

G34

G34

Variable pitch threading

)

G40

G40

G40

Disable tool insert radius compensation

)

G41

G41

G41

G42

G42

G42

G50

G92

G92

G38

G38

G38

G50.2
(G250)
G51.2
(G251)

G50.2
(G250)
G51.2
(G251)

G50.2
(250)
G51.2
(G251)

G52

G52

G52

G53

G53

G53

G54

G54

G54

G55

G55

G55

G56

G56

G56

07

00

%

%

G57

G57

G58

G58

G58

G59

G59

G59

G65

G65

G65

G66

G66

G66

)
)
)

Workpiece transfer cycle

x4

Polygonal turning. Disable

x5

Polygonal turning

x5

Defining local co-ordinate system

+

Defining machine co-ordinate system

+

20

00

14
G57

Tool insert radius leftward
compensation
Tool insert radius rightward
compensation
Selection of co-ordinate system or
selection of maximum spindle speed

00

Selection of workpiece co-ordinate
system (1 co-ordinate)
Selection of workpiece co-ordinate
system (2 co-ordinates)
Selection of workpiece co-ordinate
system (3 co-ordinates)
Selection of workpiece co-ordinate
system (4 co-ordinates)
Selection of workpiece co-ordinate
system (5 co-ordinates)
Selection of workpiece coordinate
system (6 co-ordinates)

+
+
+
+
+
+

Call macro

+

Call macro on modal mode

+

12
G67

G67

G67

Call macro on modal mode. Disable

+

G70

G70

G72

Finishing cycle

)

G71

G71

G73

Stock removal on turning

)

G72

G72

G74

Stock removal on facing

)

G73

G73

G75

Lead repetition

)

G74

G74

G76

Deep drilling on end face

)

G75

G75

G77

Drilling external/internal diameter

)

G76

G76

G78

Multiple threading cycle

)

G80

G80

G80

Drilling cycle. Disable

+2

00

10

PROGRAMMING MANUAL -38-

G Code

%
%

Group

Function

Remarks

A

B

C

G83

G83

G83

Drilling cycle on front face

+2

G84

G84

G84

Drilling and tapping cycle on front face

+2

G86

G86

G86

Boring cycle on front face

+2

G87

G87

G87

Drilling cycle on a side

+2

G88

G88

G88

Drilling and tapping cycle on a side

+2

G89

G89

G89

+2

G90

G77

G20

Boring cycle on a side
Machining cycle on inside/outside
diameter

G92

G78

G21

Threading cycle

+

G94

G79

G24

Turning cycle on end face

+

G96

G96

G96

Constant cutting rate control

)

G97

G97

G97

Constant cutting rate control. Disable

)

G98

G94

G94

Advance per minute

)

G99

G95

G95

Advance per revolution

)

-

G90

G90

Absolute programming

)

-

G91

G91

Incremental programming

)

-

G98

G98

-

G99

G99

G138

G138

G138

G238

G238

G238

G380

G380

G380

Rigid threading cycle. Disable

x2

G384

G384

G384

Rigid threading cycle

X2

01

02

05

03

11

00

Return to initial level (refer to
Explanation 6)
Return to R point level (refer to
Explanation 6)
Workpiece clamping cycle with
automatic tailstock (I)
Workpiece clamping cycle with
automatic tailstock (II)

+

)
)
x1
x1

PROGRAMMING MANUAL -39-

3. M FUNCTIONS
M functions used in machining programs are described in this section.
For M codes not included in this manual, refer to CMZ. In some machine
models, other M codes for functions different to those described herein may be
availbale.

3.1

List of M codes
These codes control functions complementary to those controlled by G codes. For instance,
coolant supply, head rotation direction, etc.
CMZ

Function

M000 Program stop
M001 Optional stop
M002 Program end
M003 Spindle 1 start (normal)
M004 Spindle 1 start (reverse)
Spindle 1/spindle 2/rotary tool spindle
M005
stop
M006 Turret head rotation (normal)
M007 Turret head rotation (reverse)
M008 Coolant ON
M009 Coolant OFF
M010 Chuck clamp (spindle 1)
M011 Chuck unclamp (spindle 1)
M012
M013
M015
M016
M018
M019
M020
M021

Chucking pressure 1 (spindle 1)
Chucking pressure 2 (spindle 1)
In-position check valid
In-position check invalid
Auxiliary coolant ON
Spindle orientation (spindle 1)
Steady rest 1 close
Steady rest 1 open

M023 Chamfering ON
M024
M025
M026
M027
M028
M029
M030
CMZ
M033

Description
All machine functions are unconditonally
stopped
Machine functions are conditinally stopepd
(OPS function activated)
End of program and CNC reset
Spindle 1 running in CW direction
Spindle 1 running in CCW direction
Spindle 1, spindle 2 and powered tool are
stopped
Turret rotates in CW direction
Turret rotates in CW direction
Coolant 1 supply ON (Coolant 1 start key)
All coolnat supplies stopped (1 and 2)
Workpiece clamped by chuck/collet on spindle
1
Workpiece released from chuck/collet on
spindle 1
Reduced pressure on spindle 1 activated
Reduced pressure on spindle 1 activated

Auxiliary coolant supply ON
Spindle 1 is oriented (without C-axis)
Steadyrest is closed
Steadyrest is opened
Tool lead-out at 45º (Thread end without
bleeding) refer to p5130
M23 disabled
Tailstock quill is moved out
Tailstock quill is moved in
Automatic tailstock base is unlocked
Automatic tailstock base is locked

Chamfering OFF
Tailstock spindle out
Tailstock spindle in
Tailstock body unclamp
Tailstock body clamp
Rigid tapping in spindle ON (spindle 1)
Program end and rewind
End of program, rewinding and CNC reset
Function
Description
Phase synchronous operation OFF
Speed synchronised on both heads

PROGRAMMING MANUAL -40-

M034 Phase synchronous operation ON
M035 Work counter/total counter
M036 Syncrhonization OFF
M040 Cut-off detection
M041 Workpiece pushing check ON
M042 Workpiece pushing check OFF
Disable steadyrest opening when the
M045
spindle is turning
M047 Workpiece ejector OUT
M048 Override cancel OFF
M049 Override cancel ON
M050 Spindle brake clamp (spindle 1)
Spindle brake unclamp (spindle 1,
M051
spindle 2)
M052 Spindle low pressure brake clamp
Contact sensor airo blow ON (spindle
M053
1)
M054 Chuck air blow ON (spindle 1)
Air blow sensor OFF for automatic
M055
toolsetter on machine (spindle 1)
M059 Chuck air blow OFF (spindle 1)
Activate spindle and tool sincronization
M060
mode
Deactivate spindle and tool
M061
sincronization mode
M062 Operation of bar feeder
M063 Movement detection
M065 Order for bar change
M066 Activate monitoring
M067 Deactivate monitoring
M070 Automatic door open
M071 Automatic door close
Automatic toolsetter arm in machine
M072
UP

Jaws and speed synchronised on the two
heads
Part counter
Synchronisation deactivated
Cutting off detection (workpiece on spindle 1)
for transfer to spindle 2
B-axis limit activated
B-axis limit deactivated
Workpiece ejector on spindle 2
Feed override is set to 100%
Feed override selector switch is released
Spindle 1 and spindle 2 braking is activated
Spindle 1 and spindle 2 braking is deactivated

Jaws on spindle 1 are blown with air
Blowing of jaws on spindle 1 is deactivated

Automatic door is opened
Automatic door is closed

M073 Parts catcher OUT

Part collector is moved out (to collect a part)

M074 Parts catcher IN

Part collector is moved in (to remove a part)

M075
M076
M080
M081
M083
M084
M085
M087
M088
CMZ
M090
M091
M092

X-mirror function is activated
X-mirror function is deactivated
C-axis mode is activated in spindle 1
C-axis mode is deactivated in both spindles
Powered tool runs in CW direction
Powered tool runs in CCW direction
Powered tool is stopped

X-axis mirror image OFF
X-axis mirror image ON
C-axis joint (spindle 1)
C-axis release (spindle 1, spindle 2)
Rotary tool spindle start (normal)
Rotary tool spindle start (reverse)
Stop rotary tool
Piece meassurement ON (spindle 1)
Piece meassurement OFF (spindle 1)
Function
Spindle indexation at 45º
Spindle indexation at 90º
Spindle indexation at 180º

Description

PROGRAMMING MANUAL -41-

Open chucks enabled when spindle is
turning
M098 Sub-program call
Sub-program end Repetition of
M099
program
M125 The part is clamped with T tailstock
M096

M126 The part is unclamped with T tailstock
M200
M201
M203
M204
M205
M210
M211
M212
M213
M219
M222
M250
M251
M252
M253
M254
M255
M257
M258
M259
M260
M261
M280

Chip conveyor forwards
Stop chip conveyor
Spindle 2 start (normal)
Spindle 2 start (reverse)
Stop of spindle 2
Chuck clamp (spindle 2)
Chuck unclamp (spindle 2)
Chucking pressure 1 (spindle 2)
Chucking pressure 2 (spindle 2)
Spindle orientation (spindle 2)
Check spindle 2 emty chucks
Clamp spindle 2 brake
Clamp spindle 2 brake pressure
Clamp spindle 2 low pressure
Contact air blow sensor ON
(subspindle)
Chuck air blow ON (spindle)
Air blow sensor OFF for automatic
toolsetter in machine (subspindle)
Air blow OFF (spindle 2)
Air blow sensor OFF (subspindle)
Chuck air blow OFF (spindle)
Activate subspindle and driven tool
syncronization
Deactivate subspindle and driven tool
syncronization
C-axis joint (spindle 2)

Open jaws enabled with head running
A sub-program is called
Return to either main program or program start
The tailstock is moved in G1 against the part
The tailstock is moved away in G1 from the
part

Spindle 2 runs in CW direction
Spindle 2 runs in CCW direction
Workpiece clamped on chuch/collet 2
Workpiece released from chuck/collet 2
Pressure reduction on spindle 2 is activated
Pressure reduction os spindle 2 is deactivated
Spindle 2 is oriented (without C-axis)
Spindle 1 and spindle braking is activated

Jaws on head 2 are blown with air

Blowing of jaws on head 2 is deactivated

C-axis mode is activated in spindle 2

M281 Deactivate C axis (spindle 2)
M287 Meassurement of piece ON (spindle 2)
Meassurement of piece OFF (spindle
M288
2)
Direct turning sense of spindle in rigid
M301
tapping (spindle 1 or 2)
Reverse turning sense of spindle in
M302
rigid tapping (spindle 1 or 2)
M303 Signal to select spindle 1
M304 Signal to select spindle 2
M306 Tool control from part program (A axis)
CMZ
Function
Tool control from PMC (axis control
M307
PMC)
M310

Automatic selection of spindle coil in
main spindle

Description

PROGRAMMING MANUAL -42-

M311
M312
M316
M318
M319
M320
M321
M322
M337
M338
M382
M383
M384
M387
M408
M409
M410
M411
M412
M413
M414
M415
M416
M417
M418
M419
M420
M421
M422
M423
M424
M425
M426
M427
M428
M429
M430
M431

Selection of LOW coil (star) in main
spindle
Selection of HIGH coil (delta) in main
spindle
Unlock turret
Unable turret turning during axis
movement
Turn back to tool zero
Automatic selection of spindle coil in
subspindle
Selection of LOW coil (star) in
subspindle
Selection of HIGH coil (delta) in
subspindle
Piston keeper up
Piston beeper down
Washing coolant ON
Washing coolant OFF
Spindle 1 orientation and roof opening
Spindle 2 orientation and roof opening
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output

M432 Part catcher cycle
CMZ
M434
M435
M438
M440
M441
M442

Function
Pressure 1 in tailstock – high
Pressure 2 in tailstock – low
Graphic mode axis C
Special M code output
Special M code output
Special M code output

Part catcher cycle (removes part from spindle 2
during another part is machined in spindle 1)
Description

Client M function
Client M function
Client M function

PROGRAMMING MANUAL -43-

M443
M444
M445
M446
M447
M448
M449
M454
M455
M456
M457
M458
M459
M470
M471
M472
M473
M474
M478
M479

Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Special M code output
Bar unloader forwards movement
signal
Bar unloader backwards movement
signal
Tailstock air blow ON
Tailstock air blow OFF
Driven tool air blow ON
Driven tool air blow OFF
Roof opening
Roof closing
Unload cycle. Stop subspindle, move
unloader forwards, open check, blow
check, move unloader backwards
Stop of operations programmed by
M472
Call to robot cycle (robot command)
Coolant through spindle 2 ON
(Taladrina 3)
Coolant through spindle 2 OFF
(Coolant 3)

Client M function
Client M function
Client M function
Client M function
Client M function
Client M function
Client M function

PROGRAMMING MANUAL -44-

4. THREADING
BBD 210

PROGRAMMING MANUAL -45-

O0008;
N10 G10 P0 Z-95;
N20 T101 (Surfacing);
N30 G50 S2500;
N40 G96 S200 G99 F.25 M3 M8 M200;
N50 G0 X70 Z0;
N60 G1 X-2;
N70 G0 X57 Z1;
N80 G1 Z0;
N90 X59.9 Z-1.5;
N100 Z-45;
N110 X66;
N120 G0 X150 Z100;
N130 T202; (Threading);
N140 G97 S700 M3;
N150 G0 X60 Z2 (Start 2 times the step);
N160 X59.4 (First pass);
N170 G32 Z-40 F1 (F=step);
N180 G0 X62;
N190 Z2;
N200 X58.8 (Second pass);
N210 G32 Z-40 F1;
N220 G0 X62;
N230 Z2;
N240 X58.7 (Last pass);
N250 G32 Z-40 F1;
N260 G0 X62;
N270 X200 Z2
00 M30;

Fixed revolutions, counterclockwise
First pass to X59.4
Threading to Z-40 step 1
Second pass X58.8
Thread until Z-40 pass 1
Last pass to X58.7
Threading until Z-40, pass 1

The outside thread area will be turned to a diameter (- 0.1 mm the metric
diameter) in order to prevent that thread tips can result in sharp edges.
G32 for threading operations, always operate at fixed rpm (G97).
When retapping threads, do not release the workpiece, do not change the
speed and do not change the start point.

PROGRAMMING MANUAL -46-

5. CONTROL FIXED CYCLES
You can find here a brief explanation of machining cycles. For a detailed
description, refer to section 13 of FANUC manual, part 1/2

5.1

G70 Finishing cycle
G70 P1000 Q1100
P Block number from which the profile operation begins.
Q Block number from which the profile operation ends.
At the end of each cycle sequence the machine is always positioned in the
position at which this cycle sequence was started. The tool will be commonly
located in the position used for rough machining.
The profile allows changing X and Z direction.

5.2

G71 Longitudinal roughing cycle parallel to Z-axis
G71 U3 R1
G71 P100 Q200 U0.3 W0.1 F0.25
U Cut depth on radius (mm).
R Retraction in radial direction from diameter to prevent touching the machined diameter
(mm).
P Block number from which the profile operation begins.
Q Number of end block of profile.
U Finishing allowance for radius on X-axis (mm).
W Finishing allowance on Z-axis (mm).
F Instantaneous feed (mm/revolution).
At the end of each cycle sequence the machine is always positioned in the
position at which this cycle sequence was started.
The positioning allows changing X- and Z-axis direction.
If the block G71 U3 R1 is entered for the first time, it will be stored in the
parameter U=P5132 and R=P5133 and will be kept until changed in either the
program or the parameter.

PROGRAMMING MANUAL -47-

5.3

G72 Cross roughing cycle transversal parallel to X-axis
G72 W3 R1
G72 P100 Q200 U0.25 W0.1 F0.3
Same as the above one, excepting for the profile.

5.4

G73 Roughing cycle with passes parallel to profile
G73 U9 W9 R3
G73 P100 Q150 U0.4 W0.1 F0.3
U Stock allowance (for radius) unmachined on X-axis (mm).
W Stock allowance on Z-axis (mm).
R Number of roughing passes.
P Block number from which the profile operation begins.
Q Number of end block of profile.
U Finishing allowance for radius on X-axis (mm).
W Finishing allowance on Z-axis (mm).
F Instantaneous feed (mm/revolution).

5.5

G74 Drilling cycle (chip breakage)
G74 R0.5
G74 Z-100 Q25000 F0.25
R Return distance on drilling to break chips (in mm), changes to P722.
Z Final drilling depth (absolute dimensions in mm).
Q Cut depth per pass (micron).
WARNING: On machines with specification in tenths of micron, “Q” data must be specified in
tenths of micron.
F Instantaneous feed (mm/revolution).

PROGRAMMING MANUAL -48-

5.6

G83 Drilling cycle (chip breakage with retraction at the start)
G0 X0 Z3
G83 Z-60 Q20000 F0.2
Z Final drilling depth (absolute dimensions in mm).
Q Cut depth per pass (micron).
WARNING: On machines with specification in tenths of micron, “Q” data must be specified in
tenths of micron.
F Instantaneous feed (mm/revolution).

5.7

G74 Front counterboring cycle
G74 R0.4
G74 X50 Z-4 P3000 Q4000 F0.15
R Retraction (mm) to break chips.
X(U) End position on X-axis (mm).
Z(W) End position in slot direction (mm).
P Displacement on X-axis for next passes (micron).
WARNING: On machines with specification in tenths of micron, “P” data must be specified in
tenths of micron.
Q Cutting depth (micron).
WARNING: On machines with specification in tenths of micron, “Q” data must be specified in
tenths of micron.
F Instantaneous feed (mm/revolution).

5.8

G75 Longitudinal grooving cycle
G75 R0.2
G75 X43 W-7.5 P4000 Q25000 F0.15
R Retraction (mm) to break chips
X Groove bottom diameter (mm).
W Groove end point on Z-axis (mm) if Z is specified in absolute dimensions and W is the
displacement in incremental mode; from left-hand to right-hand (W+) and from right-hand to
left-hand (W-), always subtracting tool width.
P Cutting depth on X-axis (micron).
WARNING: On machines with specification in tenths of micron, “P” data must be specified in
tenths of micron.
Q Displacement on Z-axis for next pass (micron).
WARNING: On machines with specification in tenths of micron, “P” data must be specified in
tenths of micron.
F Instantaneous feed (mm/revolution).
IMPORTANT: Roughing cycles are without tool radius compensation. Because
of this, higher allowances will be specified for X and Z depending on tool radius.

PROGRAMMING MANUAL -49-

5.9

G76 Threading cycle
G76 P010060 Q30 R0.03
G76 X100 Z-40 R0 P1300 Q650 F2
P01 Number of finishing passes.
P00 Thread runout; distance at which thread outlet is started, in tenths of turn Example: If
thread pitch is 2 and 20 is entered: 2mm x 2 turns = 4 mm (thread runs out 4mm before the
end point).
P60 Thread angle in degrees
Q Minimum pass (micron).
WARNING: On machines with specification in tenths of micron, “Q” data must be specified in
tenths of micron.
R Finishing allowance (mm).
X Thread bottom diameter (mm).
Z Thread end point on Z-axis (absolute dimensions in mm).
R Height difference on radius (mm) for taper threads, if start point is ø20 and end point ø20,
then R-5.
P Thread height (micron).
WARNING: On machines with specification in tenths of micron, “Q” data must be specified in
tenths of micron.
Q Cut depth for first pass (micron).
WARNING: On machines with specification in tenths of micron, “Q” data must be specified in
tenths of micron.
F Thread pich (mm).

PROGRAMMING MANUAL -50-

6. EXAMPLES OF FIXED CYCLES
6.1

G71 Fixed roughing cycle

O0071;
N10 G10 P0 Z-130;
N20 T101 (ROUGHING);
N30 G50 S2500;
N40 G96 S200 G99 F.25 M3 M8 M200;
N50 G0 X105 Z0;
N60 G1 X-2 (SURFACING);
N70 G0 X105 Z1 (STARTING POINT AND END OF FIXED CYCLE);
N80 G71 U3 R1 (DEPTH OF PASS= U3mm REMOVING R1mm);
N90 G71 P100 Q140 U2 W2 F0.3 (ROUGHING LETTING OFFSETS OF 2 mm IN X AND Z);
N100 G0 X40 (FROM BLOCK 100 TO140 THE PROFILE IS DEFINED);
N110 G1 Z-30;
N120 X60 Z-60;
N130 Z-80;
N140 X100 Z-90;
N150 G70 P100 Q140 (FINISHING CYCLE)
N160 G0 X200 Z200 M5;
N170 M30;

PROGRAMMING MANUAL -51-

6.2

G74 and G83 fixed drilling cycles (with chip breakage)
BBD 210

6.2.1 G74 Drilling cycle with a short retraction for chip breakage
O0009;
N10 G10 P0 Z-75;
N20 T808 (BORING TOOL OF 30);
N30 G97 S265 M4 F0.2 M8 M200;
N40 G0 X0 Z3;
N50 G74 R0.5;
N60 G74 Z-60 Q20000 F0.2;

Fixed Revolutions of 265rpm Av=0.2mm per
revolution
We place at X0 Z3
Boring with breaking (removing 0.5mm)
Bore until Z-60 depth: 20000 microns per
pass, Av=0.2mm per revolution
ATTENTION: in machines with specification of
“tenth of micron”, Q200000 must be set
instead of Q20000

N70 G0 X200 Z100 M30;

6.2.2 G83 Fixed drilling cycle with retraction at the start for chip
breakage and removal
N40 G0 X0 Z3 M8;
N50 G83 Z-60 Q20000 F0.2;

N60 G0 G80 X200 Z100 M30;

We place at X0 Z3
Bore until Z-60, depth 20000 microns per
pass, Av=0.2mm per revolution
ATTENTION: in machines with specification of
“tenth of micron”, Q200000 must be set
instead of Q2000000
Removing and ending

For retraction at the start, the end of program will be replaced by this end of
program; with cycle G83 the control retracts the drill to the start point (X0 Z3)
every time, thus the retraction (R05) is not entered.

PROGRAMMING MANUAL -52-

6.3

Fixed longitudinal grooving cycle

BBD 210

O0010;
N10 G10 P0 Z-110;
N20 T707 (RANURADO);
N30 G50 S1000;
N40 G96 G99 S110 M4 M200 M8;
N50 G0 X80 Z-55;
N60 G75 R.5;
N70 G75 X69 Z-28 P3000 Q2500 F.1;

Positioning the TOOL at X80 Z-55
Grooving with chip breaking (0.5 of removing)
Grooving, penetrate until ø69 and until Z(W)-28,
penetration in X 3000 microns, movement in Z
2500 microns Av=0.1mm/revolution
ATTENTION: in machines with specification of
“tenth of micron”, P30000 and Q5000 must be set
instead of P3000 y Q500

N80 G0 X200 Z200 M30;

Groove width or groove end point can be defined with a W code in this example
(W27, that is, 30 – 3 of tool), if tool is positioned on the right-hand would be (W27). For either Z or W, tool width must be subtracted.

PROGRAMMING MANUAL -53-

6.4

Threading fixed cycle

Threading in 8 passes.
Thread height
P= 0.65 x 2 (thread pitch) = 1.3 mm
1300 microns
Bottom diameter
Ø = ønominal – ( 2 x height of threads)
Ø = 60 – (2 x 1.3) = 57.4
1st pass cutting depth
Q=

Thread height
Nr. of passes

Q=

1300 microns
8

=457 microns

PROGRAMMING MANUAL -54-

O0011;
N10 G10 P0 Z-88;
N20 T101 (ROUNDING);
N30 G50 S2000;
N40 G96 G99 S200 F0.25 M4 M200 M8;
N50 G0 X68 Z0;
N60 G1 X-2;
N70 G0 X56 Z2;
N80 G1 Z0;
N90 X60 Z-2 F0.15;
N100 Z-35 F0.25;
N110 X66;
N120 G0 X200 Z100;
N130 T303 (ROSCADO);
N140 G97 S800 M4;
N150 G0 X62 Z4 (2 TIMES THE STEP);
N160 G76 P010060 Q50 R0.03;

N170 G76 X57.4 Z-30 R0 P1300 Q500 F2;

Fixed revolutions at a 800 rpm
Positioning of TOOL.
Threading fixed chicle P01/00/60: 01 passes,
00 thread exit, 60 thread angle (60º)
ATTENTION: in machines with specification of
“tenth of micron”, Q500 must be set instead of
Q50
Depth of thread ø57.4, end of thread Z-30,
finishing offsets 0, thread height 1300
microns, depth of first pass 500 microns, pass
2
ATTENTION: in machines with specification of
“tenth of micron”, P13000 and Q5000 must be
set instead of P1300 y Q500

N180 G0 X200 Z100 M30;
It must be kept in mind that in all cases when pitch is multiplied by the
revolutions the result must be ? 4000. Pitch x R.P.M. .  4000.

PROGRAMMING MANUAL -55-

6.5

Application exercise for threading operations

T1= OUTSIDE AND FACING.
T8= TWIST DRILL ø28
T10= BORING
T12= INTERNAL THREADING CUTTING
T5= EXTERNAL THREADING CUTTING
APPLY
DRILLING CYCLE
THREADING CYCLE

PROGRAMMING MANUAL -56-

PROGRAM:
O0012;
N10 G10 P0 Z-100;
N20 T101;
N30 G50 S2000;
N40 G96 G99 S200 F0.2 M4 M8 M200;
N50 G0 X73 Z0;
N60 G1 X-2;
N70 G0 X61 Z2;
N80 G1 Z0;
N90 X64.9 Z-2 F0.15 (THREAD DIAMETER);
N100 Z-35 F0.2;
N110 X70 Z-50 F0.15;
N120 X71;
N130 G0 X150 Z200;
N140 T808 (BORE OF 28);
N150 G97 S300 M4 F0.15;
N160 G0 X0 Z3;
N170 G74 R1;
N180 G74 Z-84 Q30000 F0.15; ATTENTION: in machines
with specification of “tenth of micron”, Q300000 must be set
instead of Q30000
N190 G0 Z100;
N200 T1010 (INTERNAL MACHINING);
N210 G96 G99 S150 M4 F0.2;
N220 G0 X34 Z2;
N230 G1 Z0;
N240 X29.6 Z-2 F0.15;
N250 Z-30 F0.2;
N260 X27;
N270 G0 Z100;
N280 T1212 (INTERNAL THREAD);
N290 G97 S1300 M4;
N300 G0 X28 Z4 (2 TIMES THE LENGTH OF PASS);
N310 G76 P010060 Q40 R0.03; ATTENTION: in machines
with specification of ·”tenth of micron”, Q400 must be
set instead of Q400
N320 G76 X32 Z-25 R0 P1300 Q450 F2; ATTENTION: in machines with
specification of “tenth of micron”, P13000 and Q4500 must be set instead of
P1300 y Q450
N330 G0 X250 Z100;
N340 T505 (EXTERNAL THREADING);
N350 G97 S650 M4;
N360 G0 X67 Z3 (2 TIMES THE STEP);
N370 G76 P010060 Q50 R0.04; ATTENTION: in machines with specification of “tenth of
micron”, Q500 must be set instead of Q50
N380 G76 X63.05 Z-30 R0 P975 Q400 F1.5; ATTENTION: in machines with specification of
“tenth of micron”, P9750 and Q4000 must be set instead of P975 y Q400
N390 G0 X200 Z200 M30;

PROGRAMMING MANUAL -57-

7. PROGRAMMING SIMPLIFICATION FUNCTIONS
Command and tool displacement tables are included in paragraph 13.6 of
Fanuc Manual, part 1/2.

In theses cases, considering tool direction is most important.
The easier procedure is drawing a quadrant on the drawing and locate the
degrees as shown on the above diagram.

PROGRAMMING MANUAL -58-

7.1

Direct programming of profile (angles and round edges)

PROGRAMMING MANUAL -59-

O0012;
N10 G10 P0 Z-200;
N20 T303 (PROFILING);
N30 G50 S2200;
N40 G96 G99 S230 F0.12 M4 M8 M200;
N50 G0 X0 Z3;
N60 G1 Z0 (P1);
N70 ,A90 R6 (FIRST ANGLE);
N80 X50 Z-25 ,A165 (SECOND ANGLE);
N90 ,A180
N100 X75 Z-49 ,A90 ,C1;
N110 Z-60;
N120 ,A150 R50;
N130 X185 Z-100 ,A110;
N140 ,A90 ,C2;
N150 X200 Z-150 ,A180 (P2);
N160 G0 X250 Z200 M30;

A165 comes from 180°-15°=165°

A150 comes from 180°-30°=150°
A110 comes from 180°-70°=110°

Finishing on (P3):
N140 X200 C2;
N150 Z-102 (it is not known if right or left);
You can program two angles with 2 radii or bevels as a maximum.

7.2

Compensation function
For further information on this subject, refer to section 14 on Fanuc manual, part
1/2.

PROGRAMMING MANUAL -60-

7.2.1 Tool radius compensation
1st) Type of tool (Control) T (Offsets table).
2st) Radius inserts of tool (Control) R (Offsets table).
3st) Workpiece position with respect to tool  (Part program) G41 or G42.

<EXTERNAL>

<INTERNAL>

PROGRAMMING MANUAL -61-

7.2.2 Tool types

Milling cutters are assigned with type “0” or “9” for interpolations.

PROGRAMMING MANUAL -62-

7.3

G40 G41 and G42 tool radius compensation

Tools
T1 = EXTERNAL
T8= TWIST DRILL ø38
T10 = INTERNAL

PROGRAMMING MANUAL -63-

O0013(TOOL RADIUS COMPENSATION G40, G41, G42);
N10 G10 P0 Z-95;
N20 T101 (EXTERNAL MACHINING);
N30 G50 S2200;
N40 G96 G99 S200 M4 F0.25 M8 M200;
N50 G0 X110 Z0;
N60 G1 X-2;
N70 G0 X100 Z2;
N80 G1 Z-17;
N90 G0 X102 Z3;
N100 G42 X95 Z1 (ACTIVES COMPENSATION RIGHTWARDS);
N110 G1 Z0;
N120 X97 Z-1 F0.15;
N130 Z-15 F0.2;
N140 A150;
N150 X102 Z-45 A180;
N160 X106;
N170 G0 G40 X200 Z200 (DISABLES COMPENSATION);
N180 T808 (BROCA DE 38);
N190 G97 S165 M4 F0.25;
N200 G0 X0 Z3;
N210 G74 R1 (BORING CYCLE);
N220 G74 Z-80 Q25000 F0.25; ATTENTION: in machines with specification of “tenth of
micron”, Q250000 must be set instead of Q25000
N230 G0 Z100;
N240 T1010 (INTERNAL MACHINING);
N250 G96 G99 S150 M4 F0.2;
N260 G0 X45 Z2;
N270 G1 Z-6;
N280 X41 Z-35;
N290 Z-38.9;
N300 G0 X37 Z4;
N310 G41 X48 Z2 (ACTIVES COMPENSATION LEFTWARDS);
N320 G1 Z0;
N330 X46 Z-1 F0.15;
N340 Z-6;
N350 X42 Z-35;
N360 Z-39;
N370 X37;
N380 G0 G40 X35 Z2 (DISABLES COMPENSATION);
N390 X200 Z150 M30;

PROGRAMMING MANUAL -64-

7.4 G71 Type I - Example of roughing and finishing cycle with
direct definition of profile and tool radius compensation

PROGRAMMING MANUAL -65-

O0014 (Example of roughing cycle G71 Type I);
N10 G10 P0 Z-115;
N20 T101 (EXTERNAL ROUGHING);
N30 G50 S2500;
N40 G96 G99 S200 F0.25 M4 M8 M200;
N50 G0 X115 Z2.5;
N60 G1 X-2;
N70 G0 X115 Z5;
N80 Z0;
N90 G1 X-2;
N100 G0 X111 Z2 (POSITIONING, STARTOF CYCLE);
N110 G71 U3 R1 (ROUGHING CYCLE);
N120 G71 P1000 Q1100 U0.3 W0.1 F0.25;
N1000 G0 X56 (START OF PROFILE);
N1010 G1 Z0;
N1020 X60 Z-2;
N1030 Z-22;
N1040 A170 R20;
N1050 X95 Z-50 A140 R5;
N1060 A180;
N1070 X110 Z-64 A135;
N1100 X111 (END POINT OF PROFILE);
N130 G0 X200 Z100;
N140 T303 (EXTERNAL FINISHING);
N150 G96 G99 S230 M4 F0.15;
N160 G0 G42 X111 Z2 (POSITIONING START OF CYCLE);
N170 G70 P1000 Q1100 (FINISHING CYCLE);
N180 G0 G40 X200 Z100;
N190 T505 (THREADING);
N200 G97 S800 M4;
N210 G0 X62 Z4;
N220 G76 P010055 Q50 R0.025; ATTENTION: in machines with
specification of “tenth of micron”, Q500 must be set instead of Q50
N230 G76 X57.641 Z-19 R0 P1179 Q450 F1.814; ATTENTION: in machines with
specification of “tenth of micron”, P11790 and Q4500 must be set instead of P1179 and
Q450
N240 G0 X200 Z200 M30;
All cycles ends where they are started and, because of this, finishing positioning
is done above the workpiece.

PROGRAMMING MANUAL -66-

7.5 G71 Type II - Roughing cycle with displacement direction
reversal on X-axis

PROGRAMMING MANUAL -67-

O0016 (Example of roughing cycle G71 Type II)
N10 TI01 (ROUGHING);
N20 G50 S2200;
N30 G96 G99 S200 M4 F0.25;
N40 G0 X95 Z0 M8;
N50 G1 X-2 M38;
N60 G0 G42 X92 Z2;
N70 G71 U2.5 R1;
N80 G71 P1000 Q1500 U1.2 W0 F0.2;
N1000 G0 X60 W0;
N1010 G1 Z0;
N1040 G3 X76 Z-39 R40;
N1050 G1 Z-57;
N1500 X90 Z-65;
N90 G0 G40 X200 Z100;
N100 T303 (FINISHING);
N110 G0 G42 X92 Z2;
N120 G70 P1000 Q1500;
N130 G0 G40 X200 Z200 M30;
For control units with capability for machining profiles with X-axis direction
reversal, the first block for defining the profile must state the movement of the
two axes or include “U0” or “W0”.
Roughing cycles are without tool radius compensation. Because of this, higher
allowances will be specified for X and Z depending on tool radius.

PROGRAMMING MANUAL -68-

7.6

G72 Example of cross roughing cycle parallel to X-axis

TOOLS:
T1 = EXTERNAL ROUGHING
T2 = EXTERNAL FINISHING
T6 = INTERNAL ROUGHING
T10 = INTERNAL FINISHING

PROGRAMMING MANUAL -69-

ROUGHING CYCLE APPLICATION
00017 (Example of roughing cycle G72);
N10 T101 (EXTERNAL ROUGHING);
N20 G50 S2200;
N30 G96 G99 S200 M4 F0,25;
N40 G0 X95 Z0 M8;
N50 G1 X18 M38;
N60 G0 X92 Z2;
N70 G72 W2.5 R1;
N80 G72 P1000 Q1200 U0.3 W0.15 F0.25;
N1000 G0 Z-15;
N1010 G1 X90;
N1020 X88 Z-1;4;
N1030 X55 R4;
N1040 Z-1.5;
N1200 X52 Z0;
N90 G0 X150 Z200;
N100 T606 (INTERNAL ROUGHING);
N110 G96 G99 S150 M4 F0.2;
N120 G0 X18 Z2;
N130 G71 U2.5 R1;
N140 G71 P2000 Q2100 U-0.3 W0.1 F0.2;
N2000 G0 X41;
N2010 G1 Z0;
N2020 X38 Z-1.5;
N2030 A180 R15;
N2040 X25 Z-30 A195;
N2050 X22;
N2100 X20 Z-31;
N150 G0 Z150;
N160 T1010 (INTERNAL FINISHING);
N170 G96 G99 S180 M4 F0.12;
N180 G0 G41 X18 Z2;
N190 G70 P2000 Q2100;
N200 G0 G40 X250 Z150;
N210 T303 (EXTERNAL FINISHING);
N220 G96 G99 S230 M4 F0.15
N230 G0 G41 X92 Z2
N240 G70 P1000 Q1200
N250 G0 G40 X200 M30

PROGRAMMING MANUAL -70-

7.7

M98 Repetitions of a subprogram

PROGRAMMING MANUAL -71-

SUBPROGRAM REPETITION APPLICATION
00015 (Repeating of subprogram M98);
N10 T505 (GROOVING);
N20 G96 G99 S100 M4 F0.1;
N30 G0 X74 Z-59 M8;
N40 M98 P1000 (CALLING TO SUBPROGRAM 01000);
N50 G0 Z-42;
N60 M98 P1000;
N70 G0 Z-25;
N80 X44;
N90 M98 P1000;
N100 G0 Z-10;
N110 M98 P1000;
N120 G0 X200 Z200 M30

SUBPROGRAM FOR A SLOT:
01000 (SUBPROGRAM FOR THE SLOT);
N10 G1 U-12;
N20 G4 X1;
N30 G0 U12;
N40 W-1;
N50 G1 U-4;
N60 U-2 W1;
N70 G0 U6;
N80 W1;
N90 G1 U-4;
N100 U-2 W-1;
N110 G0 U6;
N120 M99 (END OF DE SUBPROGRAM);
The subprogram is called by means of command P followed by a number. This
number consists of four or more characters.
If the number consists of four characters, it indicates the identification number of
subprogram to be called.
If the number consists of more than four characters, the first four characters,
from right to left, indicate the identification number of subprogram to be called.
Next characters indicate the number of repetitions of subprogram to be called.

PROGRAMMING MANUAL -72-

7.8

M98 Repetition of parts of a program

PROGRAMMING MANUAL -73-

PARTS OF A PROGRAM REPETITION APPLICATION:
00018 (REPEATING OF PARTS OF A PROGRAM);
N10 T404 (GROOVING);
N20 G96 G99 S90 M4 F0.1;
N30 G0 X36 Z0 M8;
N40 M98 P41001 (REPEATS FOUR TIMES 1001);
N50 G0 X200 Z200
N60 M30

SUBPROGRAM FOR A SLOT:
O1001 (SUBPROGRAM FOR GROOVING);
N10 W-10
N20 G1 X30
N30 G4 X1
N40 G0 X36
N50 M99
As described above, a subprogram or part of a subprogram is repeatedly called by means of a
command P followed by several numerical characters. In this example, the subprogram is
repeatedly called by means of “P41001”.
This command consists of three parts:
“P”  calling a subprogram.
“4”  number of subprogram repetitions.
“1001” number consisting of four characters and directly referring to the subprogram.

The maximum number of repetitions for a subprogram in a single call is
9999.

PROGRAMMING MANUAL -74-

OTHER EXAMPLE OF SUBPROGRAM EXECUTION REPETITION

PROGRAM:
O0001 (EXAMPLE OF M98);
N10 G10 PO Z-130;
N20 M98 P30002 (REPEATS 3 TIMES THE SUBPROGRAM 0002);
N30 G0 X150 Z150 M30
SUBPROGRAM
00002 (SUBPROGRAM);
N10 T101;
N25 G50 S1500;
N30 G96 S150 G99 F0.08 M4;
N40 G0 X30 Z-10;
50 G1 X-2;
N60 G0 X30;
N70 G10 P0 W10;
N80 M99

PROGRAMMING MANUAL -75-

8. FIXED CYCLES BY CMZ
In this chapter, the description of some G codes that have been programmed by CMZ is
described

8.1

G38, Checking workpiece pushing

G38 is programmed when a workpiece clamped on the head is to be moved to the sub-head.
When transferring the workpiece from the head to the sub-head, it is assumed that the workpiece will
be in contact with sub-head chuck face when the limit value preset for B-axis is reached. Then the
workpiece is clamped on the sub-head and the program advances to the following block.

G38 can be only programmed on machines equipped with sub-head (S)

COMMAND

G38 B (J)_K_F_Q_;
- G38................Workpiece push checking command.
- B....................Absolute command
This is a B-axis coordinate value for the working position at
which the workpiece will be transferred from the head to the
sub-head.
- F....................Advance (mm/min)
This is the advance speed for workpiece transfer operation.
- Q....................Transfer position tolerance.
After the workpiece is positioned on B+Q as a result of transfer
operation, the program will be advanced to the following block.

This detection operation may cause an elongation of aluminium parts,
leading to permanent deformation or damage.
Transfer advance rate must be selected depending on workpiece
material and size.
1- If B-axis position after retracted from detected transfer position is out of the
specified tolerance “B+Q”, an alarm message will be displayed
3011 CYCLE NOT COMPLETED
and the machine will be stopped.
2- If Q value is omitted, the tolerance for workpiece position will be 1 mm.
3- The approach point specified before G38 must be a point located at a
distance of 1 mm from the sub-head chuck.
4- It is assumed that all coordinate values for B-axis are negative.
5- If any cycle argument is erroneous, the following alarm message will be
displayed:
3012 ILLEGAL COMMAND

PROGRAMMING MANUAL -76-

EXAMPLE Program with G38
This function is used to transfer a workpiece from the main head to the sub-head.
Workpiece push (torque) against sub-head chuck is checked during workpiece transfer
operation.
O0001;
N1;
Machining program
(Workpiece machined on main head)
N5;
G97 S1000 M03;.....................Main head rotates at 1000 min-1
M33;........................................Speed synchronisation
M211;......................................Open sub-head chuck jaws
G0 B-_;...................................Sub-head moved to B position (approach point) (machine coordinate system) (First approach)
G98 G01 B-_F1000;................Sub-head approached to workpiece at 1000 mm/min-1 (Second
approach)
G38 B_F_Q_;..........................Workpiece push detection
Includes workpiece clamping operation on subhead.

G99;........................................Advance per revolution.
Machining program
(Cutting the workpiece)
M36;........................................Speed synchronisation disabled
G28 B0;...................................B-axis retracted to reference point.
M30;

PROGRAMMING MANUAL -77-

8.2

G138, workpiece clamping
This cycle can be replaced by G238 (refer to page 60)

G138 is programmed when a workpiece, which was previously clamped with main head, is to
be clamped with the tailstock (B-axis)
In the clamping operation, the workpiece is meant to be properly clamped when B-axis motor
torque reaches the limit value (cycle argument)
G138 is only available for machines equipped with automatic tailstock on B-axis
(T specification)

COMMAND

G138 B_ Q_ T_ S_ J_ E1 ....... Clamping
G138 D_ J_ E2 ....................... Releasing
- G138.................Workpiece clamping command.
- B.........Absolute command
This is a B-axis coordinate value for the working final position
at which the workpiece will be clamped. This value should be
never reached by the tailstock
- Q.........Tolerance of final position for workpiece clamping (mm)
After the workpiece is positioned on B - Q as a result of
transfer operation, the program will be advanced to the
following block.
- T.........Limit torque for B-axis thrust (K/cm 2).
- S.........Feedrate for final workpiece clamping (mm/min)
- D.........Feedrate for workpiece release (retraction) (mm/min)
- J..........Displacement on G1 when clamping and releasing a
workpiece.
- E.........Specifies tailstock displacement direction:
E1........Workpiece is clamed (advance).
E2........Workpiece is released (retraction).

This clamping operation may cause damage of aluminium parts, leading
to permanent deformation or damage.
Displacement and torque limit for clamping operation should be selected
according to workpiece material and dimensions.
1- If S value is omitted, the default advance value on clamping will be
200mm/min.
2- If D value is omitted, the default retraction value on clamping will be
1500mm/min.
3- If Q value is omitted, the tolerance for workpiece position will be 1mm.
4- If B-axis position after clamping a workpiece is out of the specified tolerance
"B-Q" an alarm message will be displayed:
3011 PART NOT CLAMPED
and the machine will be stopped.

PROGRAMMING MANUAL -78-

5- “Workpiece clamped” signal is activated after reaching the torque limit and
current tailstock position is within tolerance "B-Q".
6- J value is optional; its default value, when J is not programmed, is: 5 mm.
7- If any cycle argument is erroneous, the following alarm message will be
displayed:
3012 ILLEGAL COMMAND

EXAMPLE

Program with G138

Clamping a workpiece on main head.
Workpiece push (torque) against centre piece is checked during workpiece clamping
operation.
O0001;
N1;
G138 B-425.8 Q1 S700 T300 J10 E1;...... Workpiece clamping cycle
Advance the tailstock to 10 mm on G0. From this position, the tailstock
must be advanced on G1 until reaching the torque limit with
F700mm/min.
The part will be clamping, if the B-axis position is between (B, B-Q].
If the B-axis final position is greater than “B-Q” (in the example,
-424.8mm), the alarm 3011 PART NOT CLAMPED will appear.
If the B-axis final position is less or equal to “B” (in the example,
-425.8mm), the alarm 3011 PART NOT CLAMPED will appear.

G97 S1000 M03...................Main head rotates at 1000 rpm
G99; ....................................Advance per revolution.
Machining program
G138 D1500 J10 E2; Workpiece releasing cycle

The tailstock is retracted 10 mm, as J is 10; with F1500mm/min.

M30;

PROGRAMMING MANUAL -79-

8.3

G238, workpiece clamping
G238 is programmed for clamping a workpiece, which was previously clamped on main head,
on the tailstock (B-axis).
In the clamping operation, the workpiece is meant to be properly clamped when B-axis motor
torque reaches the limit value (cycle argument)
G238 is only available for machines equipped with automatic tailstock on B-axis
(T specification)

COMMAND

G238 (X_ Z_) B_ K_ Q_ T_ S_ (A_) E1.............Clamping
G238 (X_ Z_) B_ D_ J_ E2.................................Releasing
- G238................Workpiece clamping command.
- X, Z.....Absolute command
These are the X and Z coordinate values for positioning the
axes on G0. This positioning is performed simultaneously with
B-axis.
- B.........Absolute command
This is a B-axis coordinate value for the working final position
at which the workpiece will be clamped. This value should be
never reached by the tailstock.
- Q.........Tolerance of final position for workpiece clamping (mm)
After the workpiece is positioned on B - Q as a result of
clamping operation, the program will be advanced to the
following block.
- T.........Limit torque for B-axis thrust (K/cm 2).
- A.........T command for tool change it will be performed at the cycle
start.
- S.........Feedrate for final workpiece clamping (mm/min)
- D.........Feedrate for workpiece release (retraction) (mm/min)
- K.........Traverse on G1 when clamping the workpiece (mm).
- J..........Traverse on G1 when releasing the workpiece (mm).
- E.........Specifies tailstock displacement direction:
E1.......The workpiece is clamped (advance)
E2.......Workpiece is released (retraction).
This clamping operation may cause damage of aluminium parts, leading to
permanent deformation or damage.
Displacement and torque limit for clamping operation should be selected
according to workpiece material and dimensions.
If S value is omitted, the default advance value on clamping will be:
200 mm/min.
If D value is omitted, the default retraction value will be:
1500 mm/min.
1- If Q value is omitted, the tolerance for workpiece position will be 1 mm.
2- If B-axis position after clamping the workpiece is out of the specified
tolerance “B,B-Q”, the following alarm message will be displayed:
3011 PART NOT CLAMPED
and the machine will be stopped.

PROGRAMMING MANUAL -80-

3- “Workpiece clamped” signal is activated after reaching the torque limit and
current tailstock position is within tolerance "B,B-Q".
4- Programming X and Z arguments, for both clamping and releasing, is
optional.
5- If programmed, the positioning of X-, Z- and B-axis, when clamping or
releasing the workpiece, is simultaneous movement of 3 axes on G0.
6- Programming A argument is only possible during the clamping cycle and is
optional.
7- If K value is omitted, the default vale will be 10 mm. This value is only
effective on clamping cycle.
8- J value is optional, and is only effective during the releasing cycle its default
value, when B is not programmed, is: 0 mm.
9- When programming B on a releasing cycle, the J argument is optional. If J
is not programmed, the tailstock will go to B position programmed on G0
from the clamping position.
10- If B and J are programmed on a releasing cycle, the tailstock is retracted J
mm on G1 and then will go to B coordinate value programmed on G0.
11- If any cycle argument is erroneous, the following alarm message will be
displayed:
3012 ILLEGAL COMMAND

EXAMPLE Program with G238
Clamping a workpiece on main head.
Workpiece push (torque) against centre piece is checked during workpiece clamping
operation.

PROGRAMMING MANUAL -81-

O0001;
N1;
G238 X100 Z50 B-425.8 K5 Q1 S700 T250 A501 E1; .... Workpiece clamping cycle
The X, Z and B axes moving at the same time.
The tailstock is advanced to the B-position (-425.8+5=-420.8mm) on
G0, as K is 5 and B is –425.8. From this position, the tailstock is
advanced on G1 until reaching the torque, with F700mm/min, as S is
700.
After executing the part-clamping-movement, the new T code will be
executed.
The part will be clamping, if the B-axis position is between (B, B-Q].
If the B-axis final position is greater than “B-Q” (in the example,
-424.8mm), the alarm 3011 PART NOT CLAMPED will appear.
If the B-axis final position is less or equal to “B” (in the example,
-425.8mm), the alarm 3011 PART NOT CLAMPED will appear.
G97 S1000 M03..........................................Main head rotates at 1000 rpm
G99;............................................................Advance per revolution.
Machining program
G238 X250 Z250 B100 D1200 J10 E2;

Workpiece releasing cycle

It will be moved 10 mm out from the workpiece, as J is 10; with F1200
mm/min.
Then it will be retracted on G0 to the X, Z and B coordinate values.
M30;

PROGRAMMING MANUAL -82-

8.4

G384,G380 Rigid threading cycle
For threading operations, X- or Z-axis displacement per revolution of powered tool must be
equal to thread pitch.
To ensure that an accurate thread pitch is achieved, axis feed (X- or Z-axis) and powered tool
speed must be continuously synchronised.
A rigid threading cycle is disabled by entering G380 in the program.
Commands G384 and G380 can be only used on machines equipped with
powered tool.

COMMAND

< Rigid threading cycle on front end >

G384 X_C_Z_
H_R_F_S_D_M_E_Q_A_T2(T3);
< Rigid threading cycle on a side >

G384 X_C_Z_
H_R_F_S_D_M_E_Q_A_T1;
G380;
- G384..............Enables a rigid threading cycle
- G380..............Disables a rigid threading cycle
- X,Z,C..............Absolute command for positioning the tool in front of hole
centre.< Rigid threading on front end >
- R....................Used to set R point position (incremental value).
- H....................Specifies the position of hole bottom on X- or Z-axis from
point R (incremental value)
- F....................Used to set thread pitch (mm).
- S....................Used to set tool lead-in speed (min-1).
- D....................Used to set tool lead-out speed (min-1).
- A....................Specifies the command for t code, for selecting a new tool.
- M....................Used to activate head brake.
M50.............Brake of head or head 1.
M250...........Brake of head 2.
- T....................Used to set threading direction.
T1................Direction according to X-axis (threaded radial).
T2................Direction according to Z-axis (threaded axial <head 1>).
T3................Direction according to Z-axis (threaded axial <head 2>).
- Transmission ratio powered tool holder
E.................Tool holder input speed
Q.................Tool holder output speed.

If you press emergency stop or
RESET
pushbutton when a threading cycle is being
executed, special attention
should be paid to axis movements, as otherwise damage could be
caused to the machine or workpiece. Executing G380 in MDI

PROGRAMMING MANUAL -83-

1- For a threading cycle, axis and head override will be set to 100%.
2- Dry Run function is not available when a threading cycle is being executed.
3- Ensure that powered tool and head are stopped prior to executing a threading
cycle.
4- As axes and tool are synchonised, using a floating tap will not be required.
5- Powered tool speed will be limited when using a rigid threading cycle.
6 Positioning of X-, Z- and C-axis is performed on G0 simultaneously on the 3
axes. This movement is carried out when calling the cycle for the first time.
For subsequent calls, only a single coordinate value is possible. X or Z or C.
7- G384 function is programmed in all blocks requiring a rigid threading cycle. H,
R, F, S, D, M, Q, E, A and T values must not be entered in the second block in
which a rigid threading cycle is programmed, as well as in all subsequent
blocks. Only the position at which a threading operation is to be carried out must
be entered.
8- H argument is the distance from R point to hole bottom.
9- Entering the number of repeats for a rigid threading cycle is not permitted.
10- A rigid threading cycle enabled with G384 must be disabled with G380.
If another fixed cycle is entered without previously disabling a rigid threading
cycle, an alarm message (No. 3011) will be displayed. Indexing the turret with a
T command during a rigid threading cycle is not permitted.
If another fixed cycle is specified without previously cancelling the rigid threading
cycle, a collision between tool and workpiece may occur.
11- During a rigid threading cycle, turret indexing by means of command T is
carried out when starting the cycle and before positioning the axes.
12- If no D value is specified, tool lead-in and lead-out speed will be that
specified for S.
13- If neither M50 nor M250 is specified, there will be no head braking.
14- T3 value must be only specified for machins equipped with a sub-head (S).
This value must not be used to perform a front threading operation on a
workpiece located on the sub-head.
15- Commnad M250 will be only valid if a T3 value is specified.
16- If any cycle argument is erroneous, the following alarm message will be
displayed:
3012 ILLEGAL COMMAND

PROGRAMMING MANUAL -84-

EXAMPLE

Programming using G384 and G380

A rigid threading cycle (G384) (pitch: 2 mm; depth: 20 mm) is to be carried out for holes 1 to 6.
Infeed
Rapid displacement
Z30.0
(Initial point)
Normal rotation
Reverse rotation
Z15.0
(R point)
0.1 s dwell time on hole bottom
Movements for G384 on 1 - 6
O0001;
N1;
G98;........................................Advance per minute
M80;........................................C-axis on main head is activated
G28 H0;..................................Go to C-axis reference point
G97;........................................Constant head speed control is activated
Power tool is stopped

G384 X150.0 Z30.0 C30.0 H20.0 R15.0 F2.0 S300. D600. M50. T2. A101;
A rigid threading cycle is executed on point 1
- X150.0 Z30.0 C30.0
The axes are positioned on point 1 (X150, Z30, C30) at quick speed (G0).

- H20.0...........Position of hole bottom (from R)
- R15.0...........Position of R point (from initial point)
- F2.0.............Pitch: 2mm
- S300............Lead-in speed of powered tool: 300 min-1
- D600............Lead-out speed of powered tool: 600 min-1
- M50.............Main head brake
- T2................Threading direction (Z-axis direction <main head>)
- A101............Calling tool 01 with corrector 01.
When moving from initial point to R point, powered tool
rotation is stopped.

PROGRAMMING MANUAL -85-

G384 C90.0;
G384 C150.0;
A rigid threading cycle (G384) is executed on
G384 C210.0;
...............
points 2 to 6
G384 C270.0;
G384 C330.0;
G380;......................................Rigid threading cycle is disabled (G384)
G00 X200.0 Z100.0 M05;........Powered tool is stopped.
M81;........................................C-axis is disabled.
G99;........................................Advance per revolution.
M30;

PROGRAMMING MANUAL -86-

8.4.1 Calibrating of tailstock pushing force.
G138 and G238 allow the calibrating of the tailstock pushing force through the variable #130.
When an argument T [Kgf] is programmed for this G function (limit of B axis pushing force),
the tailstock makes this force against the workpiece.
If a force meassurement device is installed between the spindle and the automatic tailstock, as
can be seen on next figure, the force made by the tailstock could be read. This force should be
the same as the one programmed on by the T argument.

Fig. 1.3.1

To calibrate this force, the variable #130 of the program O9016 (for the cycle G138), or the
program O9015 (for the cycle G238) can be introduced from the keyboard, until both
measurements are the same.
The initial #130 is introduced by the manufacturer during the machine
verification process.

If the bit 4 in the parameter 3202 takes the value of “1”, the edition of registered
programs O9000 to O9999 will not be possible.

PROGRAMMING MANUAL -87-

8.5

G384,G380 Rigid threading cycle
For threading operations, X- or Z-axis displacement per revolution of powered tool must be
equal to thread pitch.
To ensure that an accurate thread pitch is achieved, axis feed (X- or Z-axis) and powered tool
speed must be continuously synchronised.
A rigid threading cycle is disabled by entering G380 in the program.
Commands G384 and G380 can be only used on machines equipped with
powered tool.

COMMAND

< Rigid threading cycle on front end >

G384 X_C_Z_
H_R_F_S_D_M_E_Q_A_T2(T3);
< Rigid threading cycle on a side >

G384 X_C_Z_
H_R_F_S_D_M_E_Q_A_T1;
G380;
- G384..............Enables a rigid threading cycle
- G380..............Disables a rigid threading cycle
- X,Z,C..............Absolute command for positioning the tool in front of hole
centre.< Rigid threading on front end >
- R....................Used to set R point position (incremental value).
- H....................Specifies the position of hole bottom on X- or Z-axis from
point R (incremental value)
- F....................Used to set thread pitch (mm).
- S....................Used to set tool lead-in speed (min-1).
- D....................Used to set tool lead-out speed (min-1).
- A....................Specifies the command for t code, for selecting a new tool.
- M....................Used to activate head brake.
M50.............Brake of head or head 1.
M250...........Brake of head 2.
- T....................Used to set threading direction.
T1................Direction according to X-axis (threaded radial).
T2................Direction according to Z-axis (threaded axial <head 1>).
T3................Direction according to Z-axis (threaded axial <head 2>).
- Transmission ratio powered tool holder
E.................Tool holder input speed
Q.................Tool holder output speed.

If you press emergency stop or
RESET
pushbutton when a threading cycle is being
executed, special attention
should be paid to axis movements, as otherwise damage could be
caused to the machine or workpiece. Executing G380 in MDI

PROGRAMMING MANUAL -88-

1- For a threading cycle, axis and head override will be set to 100%.
2- Dry Run function is not available when a threading cycle is being executed.
3- Ensure that powered tool and head are stopped prior to executing a threading
cycle.
4- As axes and tool are synchonised, using a floating tap will not be required.
5- Powered tool speed will be limited when using a rigid threading cycle.
6 Positioning of X-, Z- and C-axis is performed on G0 simultaneously on the 3
axes. This movement is carried out when calling the cycle for the first time.
For subsequent calls, only a single coordinate value is possible. X or Z or C.
7- G384 function is programmed in all blocks requiring a rigid threading cycle. H,
R, F, S, D, M, Q, E, A and T values must not be entered in the second block in
which a rigid threading cycle is programmed, as well as in all subsequent
blocks. Only the position at which a threading operation is to be carried out must
be entered.
8- H argument is the distance from R point to hole bottom.
9- Entering the number of repeats for a rigid threading cycle is not permitted.
10- A rigid threading cycle enabled with G384 must be disabled with G380.
If another fixed cycle is entered without previously disabling a rigid threading
cycle, an alarm message (No. 3011) will be displayed. Indexing the turret with a
T command during a rigid threading cycle is not permitted.
If another fixed cycle is specified without previously cancelling the rigid threading
cycle, a collision between tool and workpiece may occur.
11- During a rigid threading cycle, turret indexing by means of command T is
carried out when starting the cycle and before positioning the axes.
12- If no D value is specified, tool lead-in and lead-out speed will be that
specified for S.
13- If neither M50 nor M250 is specified, there will be no head braking.
14- T3 value must be only specified for machins equipped with a sub-head (S).
This value must not be used to perform a front threading operation on a
workpiece located on the sub-head.
15- Commnad M250 will be only valid if a T3 value is specified.
16- If any cycle argument is erroneous, the following alarm message will be
displayed:
3012 ILLEGAL COMMAND

PROGRAMMING MANUAL -89-

EXAMPLE

Programming using G384 and G380

A rigid threading cycle (G384) (pitch: 2 mm; depth: 20 mm) is to be carried out for holes 1 to 6.
Infeed
Rapid displacement
Z30.0
(Initial point)
Normal rotation
Reverse rotation
Z15.0
(R point)
0.1 s dwell time on hole bottom
Movements for G384 on 1 - 6
O0001;
N1;
G98 (G94);..............................Advance per minute
M80;........................................C-axis on main head is activated
G28 H0;..................................Go to C-axis reference point
G97;........................................Constant head speed control is activated
Power tool is stopped

G384 X150.0 Z30.0 C30.0 H20.0 R15.0 F2.0 S300. D600. M50. T2. A101;
A rigid threading cycle is executed on point 1
- X150.0 Z30.0 C30.0
The axes are positioned on point 1 (X150, Z30, C30) at quick speed (G0).

- H20.0...........Position of hole bottom (from R)
- R15.0...........Position of R point (from initial point)
- F2.0.............Pitch: 2mm
- S300............Lead-in speed of powered tool: 300 min-1
- D600............Lead-out speed of powered tool: 600 min-1
- M50.............Main head brake
- T2................Threading direction (Z-axis direction <main head>)
- A101............Calling tool 01 with corrector 01.
When moving from initial point to R point, powered tool
rotation is stopped.

PROGRAMMING MANUAL -90-

G384 C90.0;
G384 C150.0;
A rigid threading cycle (G384) is executed on
G384 C210.0;
...............
points 2 to 6
G384 C270.0;
G384 C330.0;
G380;......................................Rigid threading cycle is disabled (G384)
G00 X200.0 Z100.0 M05;........Powered tool is stopped.
M81;........................................C-axis is disabled.
G99 (G95);..............................Advance per revolution.
M30;

8.5.1 G100 Tailstock connect joint
When performing center-work, G100 Z_ moves the saddle to the position where the tailstock
can be connected to the saddle and then to the specified positioning point (Z_).
The G100 command can be used only with the programmable tailstock
specification machine.

COMMAND

G100 Z_ or G100 I1;
G100 …. Calls the tailstock connect joint mode
Z ……… Specifies the distance between the chuck face and the tailstock.
I1 ……… Specifies moving the tailstock to the parking position.
1/ Specify the G100 command independently in a block without other
commands.
2/ Specify the coordinate value of the tailstock positioning point (Z) in mm.
3/ For address Z, specify a numeric value with a decimal point.
4/ In order to get the tailstock out from the parking position the G100Z_
command should be commanded.
To execute the G100 command, the following conditions must be satisfied:
The main spindle or the rotary tool spindle is stopped.
The turret head index has completed.
The tailstock spindle is in the IN position.
During setup operation, it is recommended to record the position(s) where the
tailstock should be positioned and the position where the tailstock should be
returned after the completion of machining. The coordinate values must be
specified in the machine coordinate system.

PROGRAMMING MANUAL -91-

<Operation flow chart for G100>
<Macro program>
Positioning of the saddle to the tailstock joint position.
...
G100 Z_;
...

Execution of M27 (tailstock body unclamp; joint pin extends from the
tailstock body to connect with the saddle).
Z_ (positioning of the tailstock at the position specified by Z_)
Execution of M28 (joint pin extracts from saddle to release the
tailstock body from the saddle ; tailstock body clamp).

EXAMPLE

Programming using G100

O0005;
N1;
G100 Z_; …………………………. Moving the tailstock to the position specified by Z_ (value in
mm).
M25; ……………………………… The tailstock spindle moves OUT to hold the workpiece by
the tailstock spindle center.
G04 U_; …………………………... Calling for dwell to allow positive support of the workpiece by
the tailstock spindle center.
G50 S1000:
T0101:
G96S100M03;
...
Machining program

G28 U0; …………………………. Machine zero return of X-axis to avoid interference with the
tailstock.
M05;
M26; …………………………….. The tailstock spindle moves IN.
G04 U_; …………………………. Calling for dwell to allow tailstock spindle to correctly extract
into the tailstock body.
G100 Z_; ………………………… Moving the tailstock to the previously located position,
specified by Z_ (value in mm).

PROGRAMMING MANUAL -92-

8.5.2 G101 Tailstock connect joint
When performing center-work, G101 moves the saddle to the position where the tailstock can
be connected to the saddle and then the tailstock can be commanded to a working point.
The G101 command can be used only with the programmable tailstock
specification machine.

COMMAND

G101;
G101 …. Calls the tailstock connect joint mode
1/ Specify the G101 command independently in a block without other
commands.
To execute the G101 command, the following conditions must be satisfied:
The main spindle or the rotary tool spindle is stopped.
The turret head index has completed.
The tailstock spindle is in the IN position.
When programing G101 to get out the tailstock from park position, the joint hole
doesn’t change and the tailstock is coupled to the 2nd hole.
During setup operation, it is recommended to record the position(s) where the
tailstock should be positioned and the position where the tailstock should be
returned after the completion of machining. The coordinate values must be
specified in the machine coordinate system.

<Operation flow chart for G101>
<Macro program>
...
G101;
...

Positioning of the saddle to the tailstock joint position.

Execution of M27 (tailstock body unclamp; joint pin extends from the
tailstock body to connect with the saddle).

PROGRAMMING MANUAL -93-

EXAMPLE
Programming using G101
O0005;
N1;
G101; …………………………. Moving the Z axis to the position where the tailstock was left.
G1Z_F100; ……………………….. Approuch the tailstock to the part with the Z-axis.
M28; ………………………..… Uncouple and clamp the tailstock.
M25; ……………………………… The tailstock spindle moves OUT to hold the workpiece by
the tailstock spindle center.
G04 U_; …………………………... Calling for dwell to allow positive support of the workpiece by
the tailstock spindle center.
G50 S1000:
T0101:
G96S100M03;
...
Machining program

G28 U0; …………………………. Machine zero return of X-axis to avoid interference with the
tailstock.
M05;
M26; …………………………….. The tailstock spindle moves IN.
G04 U_; …………………………. Calling for dwell to allow tailstock spindle to correctly extract
into the tailstock body.
G101; …………………………. Moving the Z axis to the position where the tailstock was left.
G1Z_F100; ……………………… Moving the tailstock to the previously located position
specified by Z_ (absolute coordinate value).
M28; ………………………… Uncouple and clamp the tailstock.

PROGRAMMING MANUAL -94-

9. M functions made by CMZ.
In this chapter, the description of some M functions that have been programmed by CMZ can
be found

9.1

M23,M24 Angular or straight thread runout
(1) Angular runout (M23)

M23 and M24 codes are used to specify an
angular or straight runout respectively for fixed
threading cycles.
If the thread is not relieved at the thread end, as
shown on the top left figure, a M23 function must
be programmed (aungular runout.

(2) Straight runout (M24)

M24 function is used for threads relieved at the
thread end, as shown on the bottom left figure
(straight runout)
U/2 distance must be greater than
angular runout length ( r ). Refer to
bottom left figure.

COMMAND

M23; ............ Used for angular runout.
M24; ............ Used for straight runout (disables angular runout).
Special care should be taken to prevent any interference between
workpiece and tool when using an angular runout.
As shown in the figure, r distance is programmed by means of parameter 5130.
Runout angle will be 45º.

PROGRAMMING MANUAL -95-

9.2

M33, M34, M36 Synchronising operation
M33 function is used to synchronise only head
and sub-head speed.
M34 function is used to synchronise head and
sub-head phase and speed.
M36 function disables the synchronisation mode.
M33, M34 and M36 commands are
only used on machines equipped
with a sub-head (S).

COMMAND

M33; ............ Speed synchronisation.
M34; ............ Phase and speed synchronisation.
M36; ............ Synchronisation mode disabled.
1- For transferring a workpiece from main head to sub-head, head and subhead speed must be synchronised by means of M33 command. If the workpiece
is transferred without activating the synchronisation mode, scratching of
workpiece could result.
2- For transferring an hexagonal bar, head and sub-head phase and speed
must be synchronised by means of M34 command, as otherwise the transfer
operation will not be possible.
3- M36 function should be only programmed after completing a cutting cycle or
when chucks on main head and sub-head are open.
4- If a M34 function is programmed with sub-head jaws closed, alarm message
FM 102 will be displayed.
5- M5 function must not be programmed when phase and/or speed
synchronisation mode is activated. M5 function will disable the synchronisation
mode.
M34 function can de also used for round parts, but considering that phase (and
speed) synchronisation time is longer and speed synchronisation time, using
M33 function is recommended when machining round parts.

PROGRAMMING MANUAL -96-

EXAMPLE

Program with M34 and M36 (1)

These functions are used when the workpiece on main head is to be transferred to sub-head
with the synchronisation mode activated.
O0001;
Machining program.
(machining operation on main head)
N5;
G97 S1000 M03;.....................Main head rotates at 1000 min-1.
M34;........................................Phase and speed synchronisation.
After synchronising the phases, head and subhead speed is synchronised to 1000 min-1.
M211;......................................Sub-head jaws are opened.
Sub-head rotates at 1000 min-1 in reverse direction with jaws
open.
During the synchronisation, heads can be rotated
with jaws open.
G53 B-_;.................................Sub-head is moved to limit point on B-axis (machine coordinates)
(First approach)
G98 G01 B-_F1000;................Sub-head is approached to workpiece at a speed of 1000
mm/min
(Second approach)
G38 J_K_F_Q_;......................Workpiece push is detected.
Includes clamping of workpiece on sub-head.

G99;........................................Advance per revolution.
Machining program).
(Cutting operation)
M36;........................................Synchronisation mode is disabled
Sub-head is stopped while main head continues
rotating at programmed speed.
G28 B0;...................................Sub-head is returned to reference point on B-axis.
M01;

PROGRAMMING MANUAL -97-

EXAMPLE Program with M33 and M36 (2)
These functions are used when the workpiece on main head is to be transferred to sub-head
with the synchronisation mode activated.
O0001;
Machining program.
(machining operation on main head)
N5;
G97 S1000 M03;.....................Main head rotates at 1000 min-1.
M33;........................................Speed synchronisation.
Head and sub-head speed is synchronised to
1000 min-1.
M211;......................................Sub-head jaws are opened.
Sub-head rotates at 1000 min-1 in reverse direction with jaws
open.
During the synchronisation, heads can rotate with
jaws open.
G53 B-_;.................................Sub-head is moved to limit point in B-axis (machine coordinates)
(First approach)
G98 G01 B-_F1000;................Sub-head is approached to workpiece at 1000 mm/min
(Second approach)
G38 J_K_F_Q_;......................Workpiece push is detected.
Includes clamping of workpiece on sub-head.

G99;........................................Advance per revolution.
Machining program.
(Cutting operation)
M36;........................................Synchronisation mode is disabled
Sub-head is stopped while main head continues
rotating at programmed speed.
G28 B0;...................................Sub-head is returned to reference point on B-axis
M01;

PROGRAMMING MANUAL -98-

9.3

Spindles windings selection
The inetegrated spindles of machines TS and TS-Compact have two windings. By default the
selection of the spindles windings is automatic in the machine. But they can be selected using
the appropiate M codes in the part programm.
COMMAND

M310;............Automatic selection of main spindle windings.
M311; ..........Star-winding selection in main spindle.
M312; ..........Delta-winding selection in main spindle.
M320;...........Automatic selection of windongs in subspindle.
M321; ..........Star-winding selection in subspindle.
M322; ..........Delta-winding selection in subspindle.
In order to avoid any damage on machine, the work piece and the tools
and to make a correct machining of the work piece, is very important to
know the the torque and power characteristics of the wondings of the
spindles before executing any of the M codes described before.
Please look up the specifications manual sent with the machine.
1.- In machines without subspindle no execution of M320, M321 or M322 is
executed.

9.4

M40 Detection of cut workpiece
M40 function is used to check whether the cutting cycle on the workpiece transferred from
main head to sub-head is completed.
A cutting cycle is considered completed when sub-head speed is different to main head speed.
COMMAND

M40; ............ Detection of cut workpiece.
1.- M40 function can be only used on machines equipped with a sub-head (S).
2.- If the cutting cycle is not completed after executing a M40 function, the two
heads are stopped and alarm message FM41 (Cutting cycle not completed)
displayed.
3.- If a M40 function is executed with head synchronisation mode activated, the
head with the rotation is initiated (M3, M4, M203, M204) will rotate at
programmed speed. The other head will be stopped.
4.- Even though a M40 function disables head synchronisation, the operation
synchronisation mode is not disabled. Always enter a M36 function after
entering a M40 function in the program.

PROGRAMMING MANUAL -99-

EXAMPLE

Program with M40

O0001;
Machining program
(Machining operation on main head)
N5;
G97 S1000 M03;.....................Main head rotates at 1000 min-1
M33;........................................Speed synchronised in both heads.
M211;
Workpiece transfer
G99 G00 X42.0 M08;..............Advance per revolution
G01 X-06 F0.08;.....................Cutting cycle. Workpiece cut to X-0.6 at a feed speed of 0.08
mm/sec.
G28 U0 M09;
M40;........................................Detection of cut workpiece
Main head rotates at 1000 min-1 and sub-head is
stopped.
G28 W0;
M36;........................................Head synchronisation mode is disabled
G28 B0;...................................Sub-head is returned to reference point on B-axis.
M01;

PROGRAMMING MANUAL -100-

9.5

M73, M74 Workpiece collector IN/OUT
When a M73 function is executed, workpiece collector is moved to a position under the chuck
in order to collect the finished workpiece.
When a M74 function is executed, workpiece collector returns to a position near machine door
for ejection of finished part.
If you try opening machine door, workpiece collector will be retracted to a position allowing the
door to be easily opened.

COMMAND

M73; ............ Workpiece COLLECTION.
(Workpiece collector IN)

M74; ............ Workpiece EJECTION.
(Workpiece collector OUT)

1.- Before executing a M73 function, ensure that the turret is out the
interference area with workpiece collector.
2.- Singly programming a M73 or M74 function in a block without any
other command and entering a G04 function in the next block, will allow
workpiece collector movements to be completed without any
interference.
If a G04 function is not entered in the next block, next block can be
started with workpiece collector not having completed its movements
and thus with a risk of collision.
G04 time period must be longer than the time required for collecting and
ejecting the workpiece. It should be taken also into account that this
time period will depend on air pressure.
3.- If workpiece weight or volume exceeds the capacity of workpiece
collector, do not use it, as otherwise damages could be caused to the
machine.
1.- On machines equipped with a sub-head (S), don not enter a M73 function in
the program if there is any risk of collision with sub-head body.
2.- On machines equipped with a sub-head (S), B-axis displacement is not
permitted when workpiece collector is in collection position.

PROGRAMMING MANUAL -101-

EXAMPLE

Program with M73 and M74

It is assumed that the machine is equipped with a sub-head (S)
O0001;
Machining program.
(Machining operation on sub-head)
M05:........................................Sub-head is stopped
G53 B_;...................................Sub-head is moved to the position at which the workpiece is
collected by workpiece collector.

Workpiece collector operates independently
from turret position.
B-axis co-ordinate value will be the position at
which the workpiece is released from the subhead without causing any interference with
workpiece collector, turret, etc.
M73;........................................Workpiece collector is moved to collection position.
M211;......................................Workpiece released from sub-head.
G04 U_;..................................Time delay.
G28 B0;...................................B-axis is moved to reference point.
M74;........................................Workpiece collector is moved to ejection position.
M254;......................................Sub-head jaws are blown with air.
G04 U_;..................................Time delay.
M259;......................................Jaw blowing is deactivated.
M30;

PROGRAMMING MANUAL -102-

9.6

M329 Rigid threading with heads
M329 is programmed when a threading operation is required, with Z-axis, on the centreline of a
workpiece clamped on the head or sub-head.
For threading operations, Z-axis displacement per revolution of head must be equal to thread
pitch.
To ensure that an accurate thread pitch is achieved, axis feed (Z-axis) and head speed must
be continuously synchronised.
M329 may be used on all machines.

COMMAND

M329 X_ Z_ H_ R_ F_ S_ T_ A_ I_;
- M329................Command for rigid threading.
- X, Z........Absolute commands, with the position of the hole to be
machined.
- R.............Used to set R point position (incremental value) (mm).
- H.............Specifies the position of hole bottom on Z-axis (absolute
value) (mm)
- F.............Used to set thread pitch (mm).
- S.............Specifies head rotation speed for a threading operation (min 1
).
- A.............Specifies the T code for selecting a new tool.
- I..............Specifies thread direction, right-hand (0) or left-hand (1).
- T.............Used to set threading direction.
T2................Direction on Z-axis (head 1)
T3................Direction on Z-axis (head 2)

If you press emergency stop or RESET
push-button when a
threading cycle is being executed, special attention should be paid to
axis movements, as otherwise damage could be caused to the machine
or workpiece. Otherwise, the machine, workpiece or tool could be
damaged.

PROGRAMMING MANUAL -103-

1- For a threading cycle, axis and head override will be set to 100%.
2- Dry Run function is not available when a threading cycle is being executed.
3- Ensure that powered tool and head are stopped prior to executing a
threading cycle.
4- As axes and head are synchronised, using a floating tap will not be required.
5- Positioning on X- and Z-axis is performed on G0 simultaneously on the 2
axes.
6- During a rigid threading cycle, turret indexing by means of command T is
carried out when starting the cycle and before positioning the axes.
7- T3 value must be only specified for machines equipped with a sub-head (S)
(S specification). This value must not be used to perform a front threading
operation on a workpiece located on the sub-head.
8- If argument 1 is set to a value other than 1, the cycle will assume that a
right-hand thread is to be machined.
9- If any cycle argument is erroneous, the following alarm message will be
displayed:
3012 ILLEGAL COMMAND

EXAMPLE Program with M329
For performing a rigid threading operation with main head.
O0001;
N1;
Machining program
(Workpiece machined on main head)
N5;
G97 M81 M5;.........................................C-axis is deactivated and head stopped.
Before executing M329 cycle, the machine must be on head operation
mode with head stopped.
Deactivate G96 (with G97)
M329 X_ Z_ H-30.0 R_ F2.5 S400 T2 A0303 I0;
Rigid threading cycle with main head, machining a right-hand thread of
2.5 thread pitch and 30 mm depth.
Head speed during threading operation will be 400 rpm
Includes workpiece-clamping operation on sub-head.

M30;

PROGRAMMING MANUAL -104-

9.7

M432 Workpiece collection cycle
On machines equipped with a sub-head (S), it is possible to machine a new workpiece on main
head after the previous workpiece has been machined on the sub-head and at the end of the
following cycle:
Stop sub-head
Collet workpiece
Reject workpiece
The next block in the program will not be executed until the above cycle is completed.
However, M342 function will enable continuing executing the program while this cycle is being
executed.
This will allow machining a workpiece on main head immediately after completing a machining
cycle on the sub-head.
COMMAND

M432; .............Workpiece collection cycle.
This function should be programmed after machining a workpiece on the
sub-head and prior to machining a new workpiece on main head.
However, ensure that machining a workpiece on main head will not
interfere with workpiece collector and sub-head movements, as
otherwise there is a risk of collision, causing damages to the machine.
1.- Commands M210 and M211 (open and close sub-head jaws respectively)
cannot be executed when a workpiece collection cycle is being executed.
2.- The following operations, if programmed when a workpiece collection cycle is
activated, will be executed at the end of workpiece collection cycle:
- B-axis displacement
- Head phase synchronisation (M34)
- Head speed synchronisation (M33)
- Manual door opening (M30)
- Automatic door opening (M70)
- Sub-head rotation (M203/M204)
- Sub-head orientation (M219)
- Sub-head jaws blowing (M254)
3.- Programming a M432 will not be permitted in there is any interference of Baxis with workpiece collector.
4.- If a M432 is programmed in a block together with a displacement of B-axis,
workpiece collection cycle will be executed after the required B-axis
displacement is completed.

PROGRAMMING MANUAL -105-

EXAMPLE

Program with M432

The following example assumes that the machine is equipped with a bar feed.
O0001;
Machining program
(Machining operation on sub-head)
M05:........................................Sub-head is stopped
G53 B_;...................................Sub-head is moved to the position at which workpiece collector
collects the workpiece.

Workpiece collector operates independently
from turret position.
B-axis co-ordinate value will be the position on
B-axis at which the workpiece is released
from the sub-head, without causing any
interference with workpiece collector, turret,
etc.
M432;......................................Workpiece collection cycle
The sub-head is stopped.

N10;
M11;........................................Open jaws on main head.
G04 U_;..................................Time delay to allow properly opening main head jaws.
M62;........................................Bar feed (push)
M10;........................................Clamp workpiece on main head.
G04 U_;..................................Time delay to allow properly clamping a new workpiece on main
head.
N11;
G50 S2000;
G00 T0101;
G96 S120 M03;
Machining program
(Machining operation on main head)
M30;

9.8

Commands for bars unloader
COMMAND

M454; .............Bar unloader, formards command
M455; .............Bar unloader, backwards command
M472; .............Bar unloader, command for unloading start.
M473; .............Bar unloader, command for end of unloading

PROGRAMMING MANUAL -106-

9.9

Operation of chip conveyor
M codes governing the operation of chip conveyor are described below.
COMMAND

M200................................ Start chip conveyor.
M201................................ Stop chip conveyor.
If a rear chip conveyor is installed, M200 and M201 codes switch on and off
cleaning fluid, respectively, further to starting and stopping the chip conveyor.
In this case, chip conveyor operation time entered on parameter screen does
not affect cleaning fluid pump operation.

9.10 Cutting fluid
The operation mode of the various configurations available for cutting fluid pump is described
below. These configurations depend on machine type and optional attachments provided.

9.10.1

Coolant
If the machine is equipped with a single coolant pump, M8 code, while on automatic mode, will
start the pump and M38 code will stop it. You can also enter M9 code to stop the pump, as this
code will switch off all pumps, both coolant pumps and cleaning fluid pumps.
A push-button is available for starting this pump on manual mode. The LED on this pushbutton will be lighted when the pump is started.
TBI 520 machines can be provided with a second coolant pump. This pump is
started and stopped, while on automatic mode, by means of codes M18 and
M17, respectively. If a M9 code is programmed, both coolant pumps are
stopped.
This pump is optional for TBI520 machines.
Same as for the first pump, a push-button is available on control panel for starting and
stopping the second coolant pump on manual mode. (The LED will be lighted when this pump
is started)
These two coolant pumps will only operated if machine door is closed.

9.10.2

Cleaning fluid
If the machine is equipped with a rear chip conveyor, cleaning pump operation will be governed
by chip conveyor operation. By this way, when a M200 code is entered to start the chip
conveyor, the pump will be also started and will be kept running until a M201 code is entered to
stop the chip conveyor.
If the chip conveyor is located on the machine side instead of on the rear, M382 and M383
code will start and stop the pump, respectively, while on automatic mode. In this case, a pushbutton on control panel is used to start (LED lighted) and stop the pump on manual mode.

PROGRAMMING MANUAL -107-

A cleaning pump is always provided on TL machines equipped with rear chip
conveyor or B-axis.
Operation of cleaning pump will be only possible with machine door closed.

9.10.3

Supply of coolant through sub-head
This option is only available for TL machines.
Through-coolant supply will be only activated with machine door closed.
Enter M478 code to activate this function on automatic mode. By this way, both the coolant
pump and the electrovalve enabling coolant to be fed through the sub-head will be activated.
M479 or M9 code will deactivate both the coolant pump and the electrovalve, making coolant
to circulate through the turret.
Moreover, two push-buttons are provided on control panel to activate and deactivate this
function on manual mode.

9.10.4

Coolant gun
Coolant gun can be only activated with machine door open To activate coolant gun, press
coolant start push-button on main control panel.
The coolant gun is an option available for all machines.

M8
M9
M38
M18

..............
............................
........................
...........

Activates coolant pump
Deactivates both coolant and cleaning pumps
Deactivates only coolant pump cooling system.
Activates the 2nd coolant pump on all machines
equipped with this pump (TBI 520).
M17
........................
Deactivates the 2nd coolant pump machines equipped
with this pump (TBI 520).
M382
.................... If a side chip conveyor is installed, this command
activates cleaning fluid
M383
.................... If a side chip conveyor is installed, this command
deactivates cleaning fluid
M200
...................... If a rear chip conveyor is installed, this command
activates cleaning fluid pump and chip conveyor.
M201
...................... If a rear chip conveyor is installed, this command
deactivates cleaning fluid pump and chip conveyor.
M478
.................. Activates both the coolant pump and an electrovalve
opening coolant circuit through the sub-head and closing
the circuit through the turret.
M479
.................... Deactivates coolant pump and an electrovalve closing
coolant circuit through the sub-head and close the circuit
through the turret.

PROGRAMMING MANUAL -108-

10. PROGRAMMING C-AXIS AND POWERED TOOL.
This section describes the procedure used to program machining cycles requiring position
control by the head. This is the meaning of C-axis. The head will rotate and the control unit will
control head position at all moment. By this way, C-axis can be positioned according to preset
angles, be displaced on incremental mode, etc irrespective the workpiece is being machined or
not.

10.1 M codes related to C-axis functions on one or two heads
The enclosed table summarises M codes related to C-axis functions on one or two heads:
M80
M81
M280
M281

C-axis activation (head1)
C-axis deactivation (head1)
C-axis activation (head2)
C-axis deactivation (head1)

M380

C-axis activation (head1) (SuperCap)

M381

C-axis deactivation (head1). (SuperCap)

M480
M481

10.1.1
axis

C-axis activation
(head1 and head2 coupled)
C-axis deactivation
(head1 and head2 coupled)

C-axis mode is activated on head1
C-axis mode is deactivated on head1
C-axis mode is activated on head2
C-axis mode is deactivated on head2
C-axis mode is activated for head1. Used on
SuperCap
C-axis mode is deactivated for head1. Used
on SuperCap
C-axis mode is activated
on head1 and head2 coupled
C-axis mode is deactivated
on head1 and head2 coupled

M80, M81, M280 y M281 - Activation and deactivation of CWhen a command M80 is entered, C-axis operation is activated on the main head, or on the
head1.
When a command M280 is entered, C-axis operation is activated for head2.
When a command M81 is entered, C-axis operation is deactivated for main head, or for head1.
When a command M281 is entered, C-axis operation is deactivated for head2.
Commands M80, M280, M81 and M281 can be only used on machines of M
type Commands M280 and M281 can be only used on machines of SM type.
By programming command M80, M280 on automatic mode or MDI mode, head1
or head2 can be indexed to the required angular position in order to drill holes
on the circular contour of the workpiece or on the end face.
On mode M80 or M280, head rotation can be controlled synchronically with tool
movement in order to cut grooves or slots.

PROGRAMMING MANUAL -109-

COMMAND

M80; .............
M280; ...........
M81; .............
M281; ...........

C-axis mode is activated on head1.
C-axis mode is activated on head2.
C-axis mode is deactivated on main head or on head1.
C-axis mode is deactivated on head2.

For machines of SM series, chuck locking function is only enabled for the head
for which the last M command has been programmed, provided that more than
one M80 (C-axis activation for head1), M280 (C-axis activation for head2), M50
(brake activation for head1), and M250 (brake activation for head2) is
programmed in a single block. Chuck locking function is nor enabled for other
heads. Therefore, the machining operation must be performed with the head for
which the last M command is programmed. If the machining operation is
performed with other head, the powered tool will not be stopped even with jaws
open, letting the workpiece to fall or be thrown out the chuck, causing personal
injures or damages to the machine.

1- Stop the head (head1 and/or head2) by entering the command M05 (head1)
or M205 (head2) before entering commands M80, M280. If any of the last
parameters is entered with head1 or head2 rotating, the machine will be
stopped and an alarm message (FM024) will be shown on the display.
2- Before entering command M81 or M281, the powered tool must be stopped
by entering command M05 or M85. If any of these commands is entered
when the powered tool is rotating, the machine will be stopped and the
alarm message (FM025) will de shown on the display.
3- For machines of SMC series, deactivating C-axis function will not be
necessary when changing this function from a head to the other head by
means of M80 or M280.
4- For machines of SMC series, head1 or head2 will operate on C-axis mode
when entering M80 or M280 respectively. To deactivate C-axis function on
either head, only enter command M81 or M281 respectively, in case of each
head.
COMMAND

5- For machines of SMC series, if machining operations are to be carried out
with head2, C-axis must be returned to its “zero reference point” after
completing the machining operations with head1.

PROGRAMMING MANUAL -110-

10.1.2
M480 and M481 - Coupling of C-axes for head and
subhead.

Function M480 is used for coupling C-axis movement for head and subhead. For instance, this
function is used to perform C-axis operations with a workpiece simultaneously clamped on bot
heads.
By entering M481 head coupling is disengaged.
Commands M480 and M481 can be only used on machines of SMC series.

M480; ........... C-axis mode is activated on both heads, head1 and head2.
M481; ........... C-axis mode is deactivated on both heads, head1 and head2.

When C-axes on both heads are coupled, activating the hydraulic brake to lock
head1 (M50) will only be permitted. Considering that this function is used to
machine workpieces clamped on both heads, locking both heads will not be
required.

1- Stop head, head1 or head2 by entering M05 (head1) and/or head2 by
entering M205 before entering command M480. If the last command in
entered when the head1 or head2 is rotating, the machine will be stopped
and the alarm message (FM024) will be shown on the display.
2- Before entering command M481 you will need to stop the powered tool by
entering M05 or M85 command. If command M481 is programmed when
the powered tool is running, the machine will be stopped and the alarm
message (FM025) will be shown on the display.
3- For machines of SMC series, when a command M480 is entered both
heads, head1 and head2 will operate in C-axis mode. To rotate the heads,
C-axis must be deactivated by means of M81 or M281 respectively, or by
means of M481.

PROGRAMMING MANUAL -111-

10.1.3
M380, M381, M303 and M304 - Activation and deactivation
of C-axis with SuperCap.
When the control unit is provided with SuperCap tool, C-axis is activated by means of
command M380, and then enter M303 or M304 to activate C-axis mode on head1 or head2
respectively.
Command M381 deactivated C-axis function on head1 or head2.

Commands M380 and M381 are only used on machines of SMC series provided
with SUPERCAP tool.

COMMAND

M380; ........... C-axis mode is activated by means SuperCap.
M381; ........... C-axis mode is activated by means SuperCap.
M303; ........... When SuperCap is used, activates C-axis for head1 after
enabling C-axis mode by means of M380.
M304; ........... When SuperCap is used, activates C-axis for head2 after
enabling C-axis mode by means of M380.
For machines of SMC series, chuck locking function is only valid for the head for
which the last M function is entered, and provided that more than one M303
(activation of C-axis for head1), M304 (activation of C-axis for head2), M50
(head brake for head1), or M250 (head brake for head2), is entered in a single
block. Therefore, the machining process must be carried out with the head
corresponding to the M code entered in the program. If the machining operation
is carried out with the other head, the powered tool will not be stopped,
irrespective the jaws are open or not, so the workpiece could fall down or be
thrown away the chuck, causing personal injures or damages to the machine.
1- For machines of SMC series, head1 or head2 will operate in C-axis mode if
command M303 or M304, respectively, is entered in the program. To rotate
head1 or head2, C-axis mode is disabled on head1 and head2 by entering
the command M381.
2- For machines of SMC series, after using main head, C-axis must be
returned to zero position before changing to the subhead, after using the
main head.

PROGRAMMING MANUAL -112-

10.2 G83 Programming of fixed front drilling cycle with powered
tool

PROGRAM
O0004
N10 G10 P0 Z-100;
N20 T101 M8;
N30 M80 (ACTIVATES C AXIS);
N40 G98 G97 F80 M83 S800;
N50 G0 C0;
N60 X90 Z2;
N70 G83 Z-10 Q5000 H90 K4 M50 F80 (ORDER OF BORING: 90º, 180º, 270º, 0º);
ATENCIÓN: en machines with specification of “tenth of micron”, Q50000 must be set
instead of Q5000
N80 G0 G80 X150 Z150 M5;
N90 M81 (DEACTIVATES THE C AXIS);
N100 M30;
First go to C0= position then rotate the head by the angle given by M command and finally
perform the drilling operation. As the head is first rotated and then the drilling operation is
carried out, C-axis position at the beginning must be advanced by a value equal to the angle
given by H command. The number of K command indicates the number of holes and the angle
given by H command indicates the rotation angle between a hole and the next one.
H distance between two holes in degrees.
K number of holes.
M50 strong braking on head.
Q infeed interval.
G83 start of drilling cycle.
G80 end of drilling cycle.
M5 stop of powered tool.
Numbers in brackets indicate the order in which holes are drilled.

PROGRAMMING MANUAL -113-

By pressing F6 on the screen of CMZ main menu, you can gain access to a screen allowing
you to select both tool holder and its own rotation direction. By this way, when M83 is entered,
it is assumed that the tool holder will rotate in the proper direction.
ALTERNATIVE PROGRAM
This fixed drilling cycle can be programmed in the apparently more logic and simple sequence,
ie, 0º - 90º - 180º - 270º. This cycle would be as follows:

PROGRAM
O0004
N10 G10 P0 Z-100;
N20 T101 M8;
N30 M80 (ACTIVATES C AXIS);
N40 G98 G97 F80 M83 S800;
N50 G0 C0;
N60 X90 Z2;
N70 G83 Z-10 Q5000 M50 F80; ATTENTION: in machines with specification of “tenth of
micron”, Q50000 must be set instead of Q5000
N80 C90;
N90 C180;
N100 C270 (BORING ORDER: 0º, 90º, 180º, 270º);
N110 G0 G80 X150 Z150 M5;
N120 M81 (DEACTIVATES C AXIS);
N130 M30;

Numbers in brackets indicate the order in which holes are drilled.

PROGRAMMING MANUAL -114-

10.3 G87 Programming of fixed axial drilling cycle with powered tool
3 HOLES SPACED 120º

PROGRAM
O0005
N10 G10 P0 Z-120;
N20 T303 M8;
N30 M80 (ACTIVATES C AXIS);
N40 G98 F100 M83 S900 G97;
N50 G0C0;
N60 X125 Z-15;
N70 G87 X96 Q4500 H120 K3 M50 F100; ATTENTION: in machines with specification
of “tenth of micron”, Q45000 must be set instead of Q4500
N80 G0 G80 X180 Z150 M5;
N90 M81 (DEACTIVATES C AXIS);
N100 M30;
In this case, the first position must be also advanced by the angle with respect to the first hole
given by H command.

PROGRAMMING MANUAL -115-

10.4 Programming of face milling with powered tool

This operation will be performed in two passes.

PROGRAM
O0009
N10 G10 P0 Z-105;
N20 T505 M8;
N30 M80 (ACTIVATES C AXIS);
N40 G98 F100 M84 S700 G97;
N50 G0C0;
N60 X110 Z2;
N70 M98 P40020 (Calls subprogram “0020”, that Hill be executed 4 times);
N80 G0 X200 Z100 M85;
M90 M81 (DEACTIVATES C AXIS);
M100 M30;

PROGRAMMING MANUAL -116-

SUBPROGRAM O0020 FOR TBI.
N10 M50 (NORMAL PRESSURE BRAKE);
N20 G1 Z-3 F50 (1st. PASS);
N30 M52 (LOW PRESSURE BRAKE);
N40 H25 F100;
N50 M50;
N60 Z-6 F50 (2ª PASS)
N70 M52 (LOW PRESSURE BRAKE);
N80 H-25 F100;
G0 Z2 M51;
N100 H90;
N110 M99;

SUBPROGRAM O0020 FOR TL.
N10 M50 (NORMAL PRESSURE BRAKE);
N20 G1 Z-3 F50 (1ST. PASS);
N30 M51 (BRAKE);
N40 H25 F100;
N50 M50;
N60 Z-6 F50 (2ND. PASS);
N70 M51 (BRAKE);
N80 H-25 F100;
G0 Z2;
N100 H90;
N110 M99;
The weak brake is only useful with a significant force in applied by the milling cutter on the
chuck. This force will depend on workpiece material and the machining operation itself. If no
significant force is applied on the chuck, using the brake is not advisable, as otherwise this
would result in a discontinuous (step to step) feed of milling cutter.

PROGRAMMING MANUAL -117-

10.5 G112 Programming of interpolation cycle with powered tool
and coordinate change from X/C to X/Y

SEN30º= A / 30  A=30xSEN30º=15mm
COS30ª= B / 30  B=30xCOS30º=25,98mm
Geometry data:
R4
T9
PROGRAM
O0001
N10 G10 P0 Z-95;
N20 T101 (MILLING TOOL DIAMETER 8);
N30 M80;
N40 G98 F100 M83 S1000;
N50 G0C0:
N60 X80 Z-2;
N70 G112 (ACTIVATES COORDENATES TRANSFORMATION);
N80 G1 G42 X60 (P1) (G42 ACTIVATES TOOL COMPENSATION);
N90 X30 C25,98 (P2)
N100 X-30 (P3);
N110 X-60 C0 (P4);
N120 X-30 C-25,98 (P5);
N130 X30 (P6);
N140 X60 C0 (P1);
N150 G40 X80 (G40 DEACTIVATES TOOL COMPENSATION);
N160 G113 (DISABLESCOORDENATES TRANSFORMATION);
N170 M53 (ONLY IN TBI)
N180 M5;
N190 M81;
N200 G0 X150 Z150 M30;

PROGRAMMING MANUAL -118-

10.6 G112 Programming of C-axis with coordinate change from X/C
to X/Y

PROGRAM
O0033
N5 T101 (SELECTION OF MILLING TOOL);
N10 M80 (ACTIVATION OF C AXIS);
N15 M83 S1000 G98 F100 G97 (DEFINITION OF CUTTING COORDENATES);
N20 G0C0
N25 G0 X120 Z-1
N30 G112 COORDENATES TRANSFORMATION);
N35 M52 (LOW PRESSURE BRAKE, ONLY IN TBI);
N40 G42 G1 X80 (P2);
N45 X40 C30 (P3);
N50 X-100 (P4);
N55 G2 X-100 C-30 R30 (P5);
N60 G1 X40;
N65 X80 C0;
N70 G40 X120;
N75 G113 (DEACTIVATIÓN OF COORDENATES TRANSFORMATION);
N80 G0 X150 Z100;
N85 M53 (DEACTIVATES LOW PRESSURE BRAKE, ONLY IN TBI);
N90 M81 (DEACTIVATES C AXIS);
N95 M5 (STOPS DRIVEN TOOL);
N100 M30;

PROGRAMMING MANUAL -119-

10.7 Example of rigid front tapping with powered tool
This tapping operation is only performed on machines equipped with powered
tool.
This example describes a rigid tapping operation for three holes spaced 120º.

PROGRAM
O0001;
N10 T101 M5;
N20 M80 (ACTIVATION OF CAXIS);
N30 G0 C0 (POSITIONING OF C AXIS AND ACTIVATION OF SPINDLE BRAKE);
N40 X50 Z4 (POSITIONING AT FIRST POINT OF THREADING CYCLE);
N50 G384 H12 F1 S800 D800 M50 T2 (FIRST HOLE THREADING CYCLE);
N60 G384 C120 (POSITIONING AT SECOND HOLE AND THREADING CYCLE);
N70 G384 C240 (POSITIONING AT THIRD HOLE AND THREADING CYCLE);
N80 G380 (END OF CYCLE);
N90 G0 X100 Z50 M81
N100 M30;

PROGRAMMING MANUAL -120-

10.8 Example of front drilling and tapping with powered tool
The approach operation is only an example. The programmer is responsible for
entering correct values.

PROGRAM
N10 M5;
N20 T303 (BORING TOOL 8,5MM DIÁMETER);
N30 M80 (ACTIVATION OF C AXIS);
N40 G98 F80 M83 DS500 G97;
N50 G0C0;
N60 X90 Z5;
N70 G83 Z-10 Q5000 H90 K4 M50 F80 (FOUR HOLES BORING IN ORDER 2-3-4-1);
ATTENTION: in machines with specification “tenth of micron”
Q50000 must be set instead of Q5000
N80 G80 (DISABLES BORING FIXED CYCLE);
N90 G0 X200 Z200 M85 (STOPS DRIVEN TOOL);
N100 M81 (DEACTIVATES CAXIS);
N110 T606 (THREADING TOOL);
N120 M80 (ACTIVATES C AXIS);
N130 G98 G97 F80 M83;
N140 G0 C0;
N150 X90 Z5;
N160 G384 H10 S300 D300 M50 T2 F1,5 (RIGID TAPPING CYCLE AT (1));
N170 G384 C90 (RIGID TAPPING CYCLE AT (2));
N180 G384 C180 (RIGID TAPPING CYCLE AT (3));
N190 G384 C270 (RIGID TAPPING CYCLE AT (4));
N200 G380 (DISABLES FIXED CYCLE);
N230 G0 X200 Z200 M85 (REMOVE AND STOP OF DRIVEN TOOL);
N240 M81 (DEACTIVATION OF C AXIS);
N250 G99;

PROGRAMMING MANUAL -121-

10.9 Example of rigid radial tapping (side) with powered tool
This tapping operation is only performed on machines equipped with powered
tool.
This example describes a rigid tapping operation for two holes spaced 180º.

PROGRAM
O0001;
N10 T101 M5;
N20 M80 (ACTIVATION OF C AXIS);
N30 G0 C0 (POSITIONING OF C AXIS);
N40 X60 Z-10 (POSITIONING AT THREADING CYCLE STARTING POINT);
N50 G384 H30 F1 S800 D800 M50 T1 (FIRST HOLE THREADING CYCLE);
N60 G384 C180 (POSITIONING AT SECOND HOLE AND THREADING CYCLE);
N70 G380 (END OF CYCLE);
N80 G0 X100 Z50 M81
N90 M30

PROGRAMMING MANUAL -122-

10.10 Example of machining two interfaces with machining tool

Milling radius compensation must be always used in this type of programs.
In this case we are using a milling cutter of diameter 10.
Therefore, on the correction table, enter Radius = 5 and Tool type = 9.

PROGRAM
N10 T010 (MILLING TOOL DIAMETER 10);
N20 M80;
N30 G98 M83 S100 F100;
N40 G0C0X20 Z-1,3 (IN TBI MACHINES, M52 IS ADDED, LOW PRESSURE SPINDLE
BRAKE);
N50 G112;
N60 G1 G42 X10 C1,5 F300 (P1);
N70 X-8 F100 (P2);
N80 C-1,5 F2000 (P3);
N90 X8 F100 (P4);
N100 G40 X20 F600;
N110 G113;
N120 M53 (ONLY IN TBI MACHINES, DEACTIVATES SPINDLE BRAKE);
N130 G0 X150 Z100 M85;
N140 M81;
N150 M30;

PROGRAMMING MANUAL -123-

10.11 Example of machining a square using a powered tool

Tool selection and approach to start point operations are omitted and they must
be determined by the programmer.
PROGRAM
N10...;
N20...;
N30 G112 C45;
N40 G0 Z-39,4;
N50 G1 G42 X16 C4.42 F1000;
N60 X-18 F80;
N70 C-4,42 F1000;
N80 X17 F80;
N90 G40 X80 F1000;
N100 G113;
N110 M30

PROGRAMMING MANUAL -124-

10.12 Example of bevelling two squares, one with the main head and
the other with the subhead

Approach operation is omitted. The programmer is responsible for entering
correct values.
PROGRAM
;SPINDLE SIDE
N1O T1010 M8;
N20 M80 (ACTIVATION OF C AXIS IN SPINDLE);
N30 M83 G97 G98 S600 F100;
N40 G0 X50 Z-22 C0 (in spindle, the movement in Z axis is in NEGATIVE sense);
N50 G112;
N60 G1 G42 X27 C9,75 F800;
N70 X-27 F100
N80 C-9,75 F2000;
N90 27 F100;
N100 G40 X40 F2000;
N110 G113;
N120 M5;
N130 M81;
N140 M30
;SUBSPINDLE SIDE
N1O T1010 M8;
N20 M280 (ACTIVACIÓN DE EJE C EN SUBCABEZAL);
N30 M83 G97 G98 S600 F100;
N40 G0 X50 Z22 C0 (in subspindle, movement in Z axis is in POSITIVE sense);
N50 G112;
N60 G1 G42 X27 C9,75 F800;
N70 X-27 F100
N80 C-9,75 F2000;
N90 27 F100;
N100 G40 X40 F2000;
N110 G113;
N120 M5;
N130 M81;
N140 M30

PROGRAMMING MANUAL -125-

11. FUNCTIONS TO SHORTEN CYCLE TIME
The functions described below are used to shorten the time of operations that, while required
for machining a part, would extend the whole process.

11.1 M316 Unlocking the turret on out position
The turret on models TB, TL and TBI520 is of servo type with hydraulic locking. This means
that toolholder disc rotation is driven by a servomotor controlled from the NC unit and that
toolholder disc is locked on turret body by means of a hydraulic system.
Because of this, the turret must be unlocked before rotating toolholder disc. Also, the turret
must be locked after rotating toolholder disc to the required position.
Neither the locking operation nor the unlocking operation are instantaneous, but require some
time.
By means of function M316, the servo-turret is unlocked while moved out the workpiece to tool
change position and locked while moved toward the workpiece after the tool is changed.
Application example:
Program without M316

Program with M316:

N10 G10 P0 Z-100
N20 T101
N30 G50 S2500
N40 G96 S200 G99 F0,25 M3 M8
M200
N50 G0 X70 Z0
N60 G1 X-1
N70 G0 X150 Z100 M316 (the turret is
moved to the position (150,100) in
which the tool will be changed; as no
function M316 is entered, the turret
will be unlocked after reaching this
position).
N80 T202
N90 G0 X68 Z1 (after rotated and
locked, the turret is returned to the
position in which the machining
operation is started);
N91 G1 Z-50 F0.3
...

O001 (M316 example);
N10 G10 P0 Z-100;
N20 T101;
N30 G50 S2500;
N40 G96 S200 G99 F0,25 M3 M8
M200;
N50 G0 X70 Z0;
N60 G1 X-1;
N70 G0 X150 Z100 M316 (by means
of the instructions in this line, the
turret is moved to the position
(150,100) in which the tool is changed;
as a function M316 is entered, the
turret will be unlocked while moving);
N80 T202;
N90 G0 X68 Z1 (after the rotation is
completed, the turret is moved to the
position in which the machining
operation is started and locked while
moving);
N91 G1 Z-50 F0.3;
...

The sum of locking and unlocking times is saved as a result of function M316, as these
operations are performed while the turret is being moved.

PROGRAMMING MANUAL -126-

11.2 Programming three M functions in a single block
Machine models TB, TL and TBI520 equipped with Fanuc i-TB series control units enable
simultaneously executing three M functions.
This means that the three M functions are executed at the same time, irrespective the order in
which they are programmed. The total time required to execute the three M functions will be
equal to the time required to execute the slower one.

Those functions which require to be executed that a function in the same block
will be previously executed must not be entered in the same block.
For instance, neither “M80 M83” nor “M81 M85” must be entered in the same
block, as M83 and M85 require that M80 and M81 respectively will be previously
executed.
M30, M0, M1, M2, M301, M302, M303, M304 y M29 functions must be required as the first M
function of all three functions.
Do not enter “M70 M30”, but “M30 M70” (cycle end and door opening).

11.3 Using G97 to ensure the head reaching the required rotation
speed
If G96 is entered, cutting speed will be constant. This means that, for small turning diameters,
the head will reach high rotation speeds.
If when turning a small diameter a tool change is required, the turret should be moved out from
the workpiece to the position in which the tool is changed. The head will be decelerated
because this turret movement is carried out without specifying the speed. Consequently, when
the turret returns to the position in which a small diameter is turned, the head will be
accelerated until the speed required for turning this small diameter is reached.
By entering function G97 together with the required head speed, the required head rotation
speed is maintained while both moving the turret out the workpiece and returning it to the
workpiece, thus reducing the time required to accelerate the head.

PROGRAMMING MANUAL -127-

For example:
N10 G10 P0 Z-103;
N20 T101 (surfacing);
N30 G50 S3500 (R.P.M. limit);
N40 G96 G99 S200 F.25 M4 M200 M8;
N50 G0 X45 Z0 (APROXIMATIÓN);
N60 G1 X-2 (SURFACING REACHES 3500 RPM)
N70 G0 X150 Z150 G97 S3500 M316(CONSTANT TURNING SPEED 3500);
N80 T303;
N90 G0 X20 Z1 (APROXIMATION);
N100 G96 G99 S200 F.25 M4 M200 M8 (G96 IS PROGRAMMED AGAIN, BUT SPINDLE IS
ALREADY TURNING AT PROGRAMMED SPEED);
N110...........

11.4 Using M318 to change tower position while axes are being
moved.
By default, tower position is changed after all axes are moved to programmed position.
However, by using M318 code, you can change tower position before all axis movements are
completed.

As M318 enables tower movement while the axes are being moved,
you should keep in mind that a collision between the workpiece
and tool holding disc could occur if machine movements are
incorrectly programmed. Before starting a new cycle, make sure
that any interference between movements is prevented.

11.5 Eliminating the waiting time at the end of M3, M4 or M5
When M3, M4 or M5 is entered in a block, this block will remain in execution status until the
end of M function This end is reached when the head reaches the programmed revolution
speed.
To eliminate this delay, enter a small S together with M4 and a larger S in next block.
Changing S value will not stop the block being executed until a cutting movement is read (ie
G1, G2, etc).
Example (slow version):
T101
G97 S3500 M4 F0.2
G0 X0 Z2

Quicker version
T101
G97 S50 M4 F0.2
G0 X0 Z2 S3500

More quicker version
G97 S50 M4 F0.2
S3500
T101
G0 X0 Z2

12. OTHER PROGRAMMING EXAMPLES
The examples below correspond to programs commonly used and can facilitate the
programming of machining operations on similar workpieces.

12.1 Example of G72 executing an internal roughing cycle

The approach operation is only an example. The programmer is responsible for
entering correct values.

PROGRAM
N10 T606;
N20 G50 S1800;
N30 G96 S250 G99 F0,2 M3;
N40 G0 X28 Z1;
N50 G72 W2,5 R0,5;
N60 G72 P1000 Q1100 U-1 W0,1 F0,2;
N70 G1 Z-28 F0,35;
N80 X181 F0,15;
N90 Z1;
N100 G0 X200 Z100;
N110 M30

PROGRAMMING MANUAL -129-

12.2 Example of machining a pulley with inclined grooves Using
G75 Grooving cycle

The approach operation is only an example. The programmer is responsible for
entering correct values.
PROGRAM
N10 T505;
N20 G96 S140 M3 F0,15;
N30 G0 X302 Z-29,4;
N40 G75 R0,2;
N50 G75 S244,1 Z-19,6 P8000 Q3600 F0,15; ATTENTION: in
machines with specifiication of “tenth of micron”·, P80000 and Q36000
must be set instead of P8000 y Q3600
N60 G0 W-3,5 (starting point for the left inclined wall);
N70 G1 X300;
N80 X250 W3,5;
N90 G0 X302;
N100 W-7
N110 G1 X300;
N120 X250 W7;
N130 G0 X302;
N140 W9,1;
N150 G1 X300;
N160 X244,1 Z-29,4;
N170 G0 X302;
N180 Z-19,4;
N190 W3,5;
N200 G1 X300;
N210 X250 W-3,5;
N220 G0 X302;
N230 W7;
N240 G1 X300;
N250 X250 W-7;
N260 G0 X302;
N270 W9,1;
N280 G1 300;
N290 X244 Z-19,6;
N300 Z-29,4;
N310 G0 X302;
N320 X350 Z200 M30

12.3 Example of machining a circular groove without using the
grooving cycle
In this example the machining operations include facing, axial drilling and
cutting plus cylindrical grooving.

PROGRAM
N10 T101 (GROOVING);
N20 G50 S1500;
N30 G96 G99 S120 F0,1 M3;
N40 G0 X108 Z-36,5;
N50 G75 R0,5;
N60 G75 X91 W25 P5000 Q2500 F0,1 (FIRST ROUGHING);
ATTENTION: in machines with specification of “tenth of micron”, P50000 and Q25000
must be set instead of P5000 and Q2500
N70 G0 X93 Z-32,5;
N80 G75 R0,5;
N90 G75 X83 W17 P2000 Q2500 F0,1 (SECOND ROUGHING);
ATTENTION: in machines with specification of “tenth of micron” P20000 and Q25000
must be set instead of P2000 and Q2500
N100 G0 X85 Z-28;
N110 G75 R0,5;
N120 G75 X79 W8 P2000 Q2500 F0,1 (THIRD ROUGHING);
ATTENTION: in machines with specification of “tenth of micron” P50000 and Q25000
must be set instead of P5000 and Q2500
N130 G0 X150;
N140 X250 Z150;
N150 T202 (ROUND, TYPE 8, RADIUS 8);
N160 G96 G99 S120 M3 F0,15;
N170 G0 G42 X115 Z-7,5;
N180 G1 X106;
N190 G2 X106 Z-37,5 R15;
N200 G1 X110;
N210 G0 G40 X115 Z10;
N220 G42 X106 Z5;
N230 G1 Z-7;
N240 G2 X106 Z-38 R15,5;
N250 G1 Z-45;
N260 X110;
N270 G0 G40 X200 Z150 M30

PROGRAMMING MANUAL -131-

12.4 Example of machining a circular groove using the grooving
cycle
In this case, all roughing cycles will not permit tool compensation. The approach
operation is omitted, as the programmer depending of tool used should
determine it.

PROGRAM
N10 T101 (GROOVING);
N20 G50 S1500;
N30 G96 G99 S120 F0,1 M3;
N40 G0 X108 Z-36,5;
N50 G75 R0,5;
N60 G75 X91 W25 P5000 Q2500 F0,1 (FIRST ROUGHING);
ATTENTION: in machines with specification of “tenth of micron”, P50000 and Q25000
must be set instead of P5000 y Q2500
N70 G0 X93 Z-32,5;
N80 G75 R0,5;
N90 G75 X83 W17 P2000 Q2500 F0,1 (SECOND ROUGHING);
ATTENTION: in machines with specification of “tenth of micron”, P20000 and Q25000
must be set instead of P2000 and Q2500
N100 G0 X85 Z-28;
N110 G75 R0,5;
N120 G75 X79 W8 P2000 Q2500 F0,1 (THIRD ROUGHING);
ATTENTION: in the machines with specification of “tenth of micron”, P50000 and
Q25000 must be set instead of P5000 and Q2500
N130 G0 X150;
N140 X250 Z150;
N150 T202 (ROUND, TYPE 8, RADIUS 8);
N160 G96 G99 S120 M3 F0,15;
N170 G0 G42 X115 Z-7,5;
N180 G1 X106;
N190 G2 X106 Z-37,5 R15;
N200 G1 X110;
N210 G0 G40 X115 Z10;

N220 G42 X106 Z5;
N230 G1 Z-7;
N240 G2 X106 Z-38 R15,5;
N250 G1 Z-45;
N260 X110;
N270 G0 G40 X200 Z150 M30;

PROGRAMMING MANUAL -133-

Please, fill this Form with your comments

Date ______________________

To help us to improve this manual, we invite you to send us your comments about any insufficient
description or error found in this manual. Please, limit your comments to the aspects related to this
manual.
Manual designation:
Issue No.:
Name

Company

Department

Telephone

Address
Chapter

Page

Line

Comments/requests

Only for use by CMZ– Please, let blank.
Description

Reception No.

Received by

Sign up to vote on this title
UsefulNot useful