CNC Turning Machine
CNC Turning Machine
CONTROL
CNC TURNING MACHINE
This chapter describes the basic considerations for creating a program.
CONTENTS
A : BEFORE PROGRAMMING
7) Machining
EXAMPLE
00001: Program number
N1;
G50 S2000;
G00 T0202 (M41);
M30;
NOTE: 1) The program number can have less than four significant digits. It can be
input using less than four digits. For example, even if a program
number is input as 01-, the screen will automatically display
"00001 ".
2) If a program number to be input is already in the memory, that
number, and therefore that program cannot be input. Change its
number to input the program.
5.2 Sequence Number
The sequence number is used to search for or call the position that is being executed, or to
facilitate finding the position you want to edit in the program easily.
Generally, a sequence number is entered at a key point in the program (e.g. part program
for each tool).
The sequence number is expressed as a number of 4 digits or less (1 to 9999), following the
alphabet "N".
EXAMPLE
00001:
N1; Sequence number
G00 T0202 (M41);
M30;
If a program is too long and exceeds the memory capacity, put the sequence
numbers at the beginning of the program for each process, or do not specify
these numbers. This will help save memory capacity.
5.3 Part Program
The part program is used to specify the machining process for a single cutting tool.
Each process (1st process, 2nd process...) for machining a component contains the part
programs for as many tools as are necessary to complete each process.
EXAMPLE
00001:
N1;
N2:
G50 S2500;
G00 T0404 (M42); Part program for the tool No. 4
M30;
5.4 Address
An address is expressed using letters.
5.5 Data
The numbers (including the sign and decimal point) that follow the address are called the
"data".
In addition, the information (program and other) to be input to the NC for machining the
workpiece is also called the data.
5.6 Word
A word is the minimum unit for specifying functions. A word consists of a numerical value
and the data.
5.7 Block
2) On the tape (program), the portion enclosed by the end of blocks (CR) is one block.
5.8 Summary
6. Axis Control and Direction
In this NC lathe, movement takes place along two axes. These axes are called the
X-axis and the Z-axis.
This section describes movement along the axes and its relationship with the program.
Knowing the direction of the controlled axes is essential when creating a program.
Workpiece zero point ......To program, the workpiece zero point in a program must be
determined in advance. This workpiece zero point (XO,
ZO) is treated as the reference for programming the starting
travel.
X-axis ...............................Radial dimensions of the workpiece are described with
address X. The spindle center line is X0.
Z-axis ...............................Longitudinal dimensions of the workpiece are described with
address Z. The workpiece finished end surface is Z0.
Chuck Work
6.2 AL-22S
In the AL-22S, movement takes place along three axes. These axes are called the X-axis,
Z-axis and B-axis.
This section describes movement along the axes and their relationships in the program.
Knowing the direction of motion along the controlled axes is essential when creating a
program.
Workpiece zero point .............To program, the workpiece zero point in a program must be
determined in advance. This workpiece zero point
(XO, ZO) is treated as the reference for programming the
starting travel.
NOTE: In the cutting-off process, headstock 2 moves along the Z-axis when a
workpiece is transferred from headstock 1 to headstock 2.
The following two methods can be used to specify movement of a tool from one point
to the next point.
1) Absolute command
2) Incremental command
How these two commands work must be fully understood to create a program.
EXAMPLE 1
To move the tool from point 1 to 2 in the figure below, specify the following:
From 1 X 20.0 Z10.0;
To 2 X 10.0 Z-5.0;
The X coordinate of point 4 : According to the C10 command, the chamfer size 10 mm is
subtracted from the 100 mm diameter. Since the X-axis dimensions are all diametral values, the
chamfer size of 10 mm is first converted into a diametral value.
10 mm x2=20 mm
Then this is subtracted from 100 mm.
100-20=80
The X coordinate of point 4 is determined to be 80.0.
5. The Z coordinate of point 5 : the chamfer size of 10 mm is added to 50 mm. Since the
Z dimensions are all measured in the negative direction from the workpiece zero point, the Z
coordinate of point 5 is Z-60.0.
7.2 Incremental Command
This command indicates the direction and distance that you want to move from the current
tool position.
In the incremental mode, address U and W are used instead of X and Z, respectively.
EXAMPLE 1
When the tool moves from 1 to 2 , as in the figure below, this movement is specified
as follows:
From point 3 to point 4 , the tool moves only along the X-axis. W, therefore,
which defines movement along the Z-axis is not specified.
The cutting conditions that are set when creating a program have a great influence on the
machining efficiency and accuracy. These conditions must be checked carefully.
The following three cutting conditions are necessary for machining the workpiece with the
NC lathe.
A program. is created using alphabets which show functions, and numerical values.
The G, M, S, F, and T functions represent the main functions.
This section describes the addresses used in the program and their functions.
11. Basic Pattern of Program
This manual describes all program numbers as 4 digit integers. When actually creating or
inputting a program, it is not necessary to use a 4-digit number. The NC automatically
displays the input as a 4 digit number. (integer)
For example, if "01 " is input, it is automatically stored in the NC memory as "00001".
However, program numbers of five digits or more cannot be input.
The following signs and symbols can be used in accordance with their purpose:
12.4 Decimal Point
It is possible to input a number value with a decimal point to the NC. A decimal point is
used to input any unit of distance, time, or speed. However, for some addresses, a decimal
point cannot be input. Inputting a decimal point is limited to "mm", "inch", "deg", or "sec".
NOTE: 1) When specifying a dwell command, it is possible to input a decimal point for
the address X, but not possible for address R (Because P is also used for
specifying the sequence number.)
2) Please pay careful attention to inputting a decimal point.
Metric setting (G21 command is used.)
X1.0 X1 mm
X1 X0.001 mm (If a decimal point is not used, the value is
regarded as the least input increment.)
3) It is possible to input a word using a decimal point, or the word without the
decimal in the same program.
X1000 Z23.7;
X10.0 Z22359;
This chapter describes the G functions.
The tool nose radius offset, outlined in Section 10, "G40, G41, G42 Tool Nose
Radius Offset" and the multiple repetitive cycles, outlined in Section 15, "G70-G76
Multiple Repetitive Cycle", are detailed in Chapter D, "AUTOMATIC TOOL NOSE
RADIUS OFFSET" and Chapter G, "MULTIPLE REPETITIVE CYCLES".
CONTENTS
B : G FUNCTIONS
1. G Code List...............................................................................B-1
2. G00
Positioning the Cutting Tool at a Rapid Traverse Rate ....................B-4
3. G01
Moving the Cutting Tool Along a Straight Path Cutting Feedrate ......B-8
4. G02, G03
Moving the Cutting Tool Along Arcs at a Cutting Feedrate .............B-10
5. G50
Setting the Spindle Speed Limit ................................................B-12
6. G96
Maintaining a Constant Surface Speed .....................................B-14
7. G97
Maintaining a Constant Spindle Speed .....................................B-16
8. G04
Suspending Axis Feed (Dwell) ..................................................B-18
9. G98, G99
Setting Feedrate Units .............................................................B-20
11. G32
Thread Cutting .........................................................................B–26
12. G92
Thread Cutting Cycle ................................................................B-34
13. G90
O.D./I.D. Turning Cycle ...........................................................B-44
14. G94
Facing Cycle............................................................................B-50
15. G70-G76
Multiple Repetitive Cycle ........................................................B - 56
16. G01
Chamfering and Rounding Functions .....................................B - 58
19. G27
Checking Zero Return .............................................................B - 68
20. G28
Returning the Axes to Machine Zero Automatically ......................B - 70
21. G50
Setting the Coordinate System ..............................................B - 72
22. G53
Selecting the Machine Coordinate System ............................B - 74
23. G54-G59
Setting a Work Coordinate System .......................................B - 76
1. G Code List
G codes are also called preparatory functions. The G codes, consisting of the address G
and a two-digit numerical value define the machining method and the axis movement
mode in a specified block. The NC establishes the control mode in response to the
specified G code.
The two-digit numerical value following address G defines the commands written in that
block. Depending on how the G codes remain valid, they are classified into the following
two types:
The following example program shows how the programmed blocks are governed by the
G codes; G00 and G01 are both modal.
* : With MORIC-T6FII, G71 is optional.
NOTE: 1) More than one G code, each belonging to a different G code group,
may be specified in the same block.
2) The NC establishes the G code modes, identified by the ► symbol,
when the power is turned on or when the reset key is pressed.
3) The G codes in group 00 are valid only once in the specified block.
2. G00 Positioning the Cutting Tool at a Rapid Traverse Rate
<Command format>
NOTE: 1) Once the G00 command is specified, it remains valid until another G code in
the 01 group is specified. GO1, G02, and G03 are examples of G codes in
the 01 group. G codes that remain valid until another G code in the same group
is specified are called modal G codes. The G code groups are given in 1,"G
Code List".
2) The maximum rapid traverse rate varies among machine models. For
the maximum rapid traverse rate programmable with your machine, refer to
the maintenance manual or operation manual supplied with the machine.
3) The rapid traverse rate is adjustable by using the rapid traverse rate override
switch on the machine operation panel.
4) If the two axes are specified in the G00 mode at the same time, the
generated tool path is not always a straight line.
EXAMPLE I
To use the GOO mode to advance and retract the cutting tool to and from the workpiece.
1 To point A
Rapid traverse to a point near the workpiece.
2 Point A Point B
Rapid traverse
Part program
3 Point C
Rapid traverse to point C to retract the cutting tool from the workpiece.
4 Point C Point D
Rapid traverse to the position where the turret head is rotated.
Center work operation:
If the cutting tool interferes with the tailstock, move the Z-axis first when bringing
the cutting tool near the workpiece. Then move the X-axis to the cutting start point.
3. G01 Moving the Cutting Tool Along a Straight Path Cutting Feedrate
<Command format>
NOTE: 1) Once the G01 command is specified, it remains valid until another G code in
the 01 group is specified. G00, G02, and G03 are examples of G codes
in the 01 group. G codes that remain valid until another G code in the same
group is specified are called modal G codes. The G code groups are
given in 1, "G CODE LIST".
2) The programmed feedrate is adjustable by using the feedrate override
switch on the machine operation panel.
3) The feedrate data is "0" until an F code is specified.
If the axis feed commands are read when a program is executed, the
machine will not operate, unless an F code displayed. In this case, an alarm
message will be displayed.
4) When the power is turned on, the NC will be in the G99 (feed per
revolution) mode.
EXAMPLE
To use the G01 mode for axis feed along the path A B C D E.
1 To point A
Rapid traverse to a point near the workpiece
2 Point A Point B
The cutting tool is moved at a feedrate of 2.0 mm/rev.
3 Point B Point C
The workpiece is cut at a feedrate of 0.2 mm/rev. The programmed feedrate 0.2
mm/rev remains valid up to point E.
4 Point C Point D
5 Point D Point E
6 Point E Point F
Rapid traverse to point F to retract the cutting tool from the workpiece.
7 Point F Point G
Rapid traverse to the position where the turret head can be rotated.
4. G02, G03 Moving The Cutting Tool Along Arcs at a Cutting Feedrate
1 To point A
The programmed feedrate 0.2 mm/rev remains valid up to point E.
2 Point A Point B
3 Point B Point C
A clockwise arc wit a radius of 3 mm is defined.
4 Point C Point D
5 Point D Point E
A counterclockwise arc with a radius of 5 mm is defined.
5. G50 Setting the Spindle Speed Limit
NOTE: 1) When a program is written in the G96 mode, the spindle speed limit must be
specified in the G50 block before entering the G96 mode.
2) For a program written in the G97 mode, designation of the spindle speed limit
using the G50 command is ignored.
G50 S2000;
G97 S2500 M03; The spindle rotates at 2500 min-1.
3) The spindle speed override function remains valid if the limit speed is set by
"G50 S_;"
The spindle speed override setting must be smaller than 100%.
EXAMPLE
1 The spindle speed limit for automatic operation is set to 2000 min -1.
2 A cutting speed of 200 m/min is specified.
The spindle speed is controlled to maintain the programmed cutting speed.
3 - 5
The facing operation is carried out toward the center (X0). Near the center, the
machine will reach its allowable maximum spindle speed. However, since the spindle
speed limit of 2000 min -1 has been specified in the G50 block, the spindle
speed is clamped at the specified speed.
6. G96 Maintaining a Constant Surface Speed
For example, if the cutting speed (V) is specified at 100 m/min to cut a 30 mm diameter
workpiece, the spindle speed is calculated as indicated below.
N=
N=
N = 1061 (min-1)
Generally, the standard cutting speed is determined according to the material of the
workpiece and cutting tool.
<Command format>
G96__S;
G96 ............Calls the constant surface speed control mode.
S .................Specifies the cutting speed (m/min).
NOTE: In the G96 (constant surface speed control) mode, the spindle speed changes
as the cutting tool moves in the X-axis direction. In a facing operation, the
spindle speed increases and reaches the maximum allowable spindle speed to
maintain the constant cutting speed, as the cutting tool approaches the
center. This constitutes a hazardous situation since the workpiece may fly out of
the chuck. To ensure safety, it is necessary to set the spindle speed limit for the
constant surface speed control using "G50 S_;" before entering the G96 mode.
The spindle speed limit should be selected from the lowest speed among the
allowable maximum speeds of the spindle, chuck, and fixture.
EXAMPLE
To use the G96 mode for facing operation:
1 The spindle speed limit for an automatic operation is set to 2000 min-1.
3 The spindle starts rotating forward at a speed to provide a cutting speed of 120
m/min.
6 Facing
The workpiece end face is cut at 0.2 mm/rev up to the center of the
workpiece. To maintain the constant cutting speed, the spindle speed increases as
the cutting tool approaches the center (X0). However, the spindle speed limit of
2000 mini has been specified in the G50 block, the spindle speed is clamped
at the specified speed.
7. G97 Maintaining a Constant Spindle Speed
The G97 command is used to call the mode in
which a constant spindle speed is maintained.
During automatic operation, the spindle rotates at
the programmed speed.
N=
N : Spindle speed (min -1)
V : Cutting speed (m/min)
D : Cutting diameter (mm)
: Circumference constant
For a thread cutting operation, always specify the G97 command to maintain the
constant spindle speed. During the thread cutting operation, the thread is cut
gradually by changing the cutting depth for each thread cutting path while
maintaining the start point of the thread. Therefore, if the spindle speed is not kept
constant, the start point shifts in each thread cutting cycle making constant lead
thread cutting impossible.
<Command format>
G97 S__;
G97 ........Calls the constant spindle speed command mode.
S ............Specifies the spindle speed (min-').
NOTE: 1) In the G97 mode, the spindle speed limit specified with the G50
command is ignored.
Example:
G50 S1500;
G97 S2000 M03;
The spindle rotates at 2000 min-1 and the spindle speed limit (1500
min-1) is ignored.
2) G96 S100;
G97;
If the spindle speed control mode is changed from G96 to G97 without
a spindle speed command (S code) specified for the G97 mode as
indicated above, the spindle speed obtained in the block preceding the
G97 block is used as the spindle speed.
EXAMPLE
O.D. thread cutting:
NOTE: 1) A decimal point is not allowed when address P is used to specify the
duration of the dwell period.
Dwell for 1.5 seconds…….. G 0 4 P 1 5 0 0 ;
Dwell for 2.3 seconds………G 0 4 P 2 3 0 0 ;
2) Programmable dwell period is 0.001 to 99999.999 seconds.
3) The dwell function is valid only in the specified block.
4) Dwell period per rotation of the spindle is calculated as follows:
60 (sec)
t (sec) =
Spindle speed (min-1)
5) An alarm occurs if a T command is written in the G04 block.
EXAMPLE
1 To point A
Rapid traverse to position the grooving tool to point A.
2 Point A Point B
Grooving up to point B.
3 At point B
Dwelling for 0.1 seconds at the bottom of the groove. The period required for the
spindle to make one turn is calculated as indicated below if the spindle speed is 800
min-1.
60 (sec)
Period (sec) = = 0,075 (sec)
800 (min-1)
To finish the bottom of the groove, it is necessary to suspend axis feed for a period to
allow the spindle to rotate more than one turn; the dwell period should be set to 0.1
seconds.
4 Point B Point A
Returning to point A at the programmed feedrate.
G98
The G98 command calls the mode in which
axis feedrates specified by F codes are
interpreted in units of mm per minute. This
mode is used when the bar feeder, the pull-
out finger, or the rotary tool is used.
G99
The G99 command calls the mode in which
the axis feedrates specified by F codes are
interpreted in units of mm per revolution.
This mode is used for general turning
operations such as O.D. cutting, I.D. cutting,
and thread cutting.
NOTE: 1) The G98 and G99 commands are modal. Therefore, once the G98
command is specified, it remains valid until the G99 command is specified, or vice versa.
2) When the power is turned on, the G99 (mm/rev) mode will be set.
EXAMPLE 1
1 Since the G99 command is specified, the F codes are interpreted in units of mm/rev.
As indicated in the above program, the G99 command may be written in a program
to set the mm/rev mode. However, the G99 command is not usually written in a
program because the G99 mode is automatically established when the NC is reset
by the M02 or M30 command or when the power is turned on.
EXAMPLE 2
The tool nose does not have a sharp edge but is rounded as
illustrated on the right. Therefore, the point of the tool nose used
for programming is offset from the actual cutting point. The tool
nose radius offset function is used to eliminate dimensional errors
caused by this difference.
For details on the G40, G41 and G42 commands, refer to Chapter D, "AUTOMATIC
TOOL NOSE RADIUS OFFSET".
EXAMPLE
1 To Point A
Positions to X50.0, Z10.0 at rapid traverse.
Since the G42 command is specified, the tool nose radius offset function becomes
valid from this block.
2 Point A Point B
The cutting tool is moved at a feedrate of 1.0 mm/min.
3 Point B Point C
The cutting tool is moved to Z-30.0 at the rate of 0.2 mm/min.
4 Point F Point G
The cutting tool retracts to a point (U1.0, Z10.0) at a rapid traverse.
This block is the cancel mode block because the G40 command is specified in this
block.
11. G32 Thread Cutting
At the start and end of axis feed, axis feed is automatically accelerated or decelerated
to avoid shock to the machine. Consequently, inaccurate thread leads are generated
where thread cutting starts and ends. These areas are referred to as incomplete
thread portions.
The incomplete thread cutting portions are calculated using the following formula.
L1 = L1 = Incomplete thread portion (at the start of thread cutting) (mm)
L2 = Incomplete thread portion (at the end of thread cutting) (mm)
L2= N: Spindle speed (mine)
P: Lead (mm)
In actual programming, the incomplete thread portions should be taken a little larger
than the calculated lengths to avoid interference between the cutting tool and
workpiece and to allow for a margin of safety.
EXAMPLE 1
Straight thread cutting:
00001;
G00 T0404;
G97 S1200 M03;
X60.0 Z10.0;
X30.0;
G32 Z-52.0 F2.0;
G00 X60.0; Z10.0;
X29.0;
G32 Z-52.0;
G00 X60.0;
Z10.0;
X28.5;
G32 Z-52.0;
G00 X60.0;
Z10.0;
X28.0;
G32 Z-52.0;
G00 X60.0;
Z10.0;
X27.8;
G32 Z-52.0;
G00 X60.0;
Z10.0;
X27.62;
G32 Z-52.0;
G00 X60.0;
Z10.0;
X150.0 Z50.0;
NOTE: The thread cutting depth and the number of cuts are indicated in the table
given on Page B - 43. For the actual thread cutting operation, use a
thread gage to measure the dimensions since the values in the table
are only for reference.
EXAMPLE 2
Tapered thread cutting (PT-2 ½) :
00001;
G00 T0404;
G97 S424 M03;
X80.0 Z8.0;
X73.59;
G32 X75.84 Z-28.08 F2.3091;
G00 X80.0;
Z8.0;
X72.59;
G32 X74.84 Z-28.08;
G00 X80.0;
Z8.0;
X71.59;
G32 X73.84 Z-28.08;
G00 X80.0;
Z8.0;
X70.7;
G32 X72.95 Z-28.08;
G00 X80.0;
Z8.0;
X70.63;
G32 X72.88 Z-28.08;
G00 X80.0;
Z8.0;
X150.0 Z100.0;
EXAMPLE 3
An example program to carry out thread cutting three times with a 1 mm depth of
cut for each cycle.
00001;
G0 0 T0 4 0 4 ;
G97 S318 M03;
X106.0 Z20.0;
Z-1.0;
G32 X68.0 F4.0;
G00 Z20.0;
X106.0;
Z-2.0;
G32 X68.0;
G00 Z20.0;
X106.0;
Z-3.0;
G32 X68.0;
G00 Z20.0;
X106.0;
G00 X200.0 Z100.0 M05;
M30;
<Determining the spindle speed>
1) Limits due to rapid traverse rate
NOTE: The above numerical values are only for reference. Depending on the
selected cutting conditions, the cutting load may become excessive. If a servo
alarm occurs, change the cutting conditions.
When writing a program, L1 and L2 should be longer than the calculated theoretical
values. Therefore, Li and L 2 should be set to 3 mm and 1 mm, respectively.
1) During the thread cutting operation, the feedrate override* setting is ignored.
*Override: The feedrate override function is used to change the feedrate with the
switch on the operation panel.
2) Thread cutting must be carried out while the spindle rotates at a fixed speed.
Therefore, specify the G97 command to carry out thread cutting.
3) The feedrate during thread cutting is limited by the value calculated in the following
formula.
At the start and end of axis feed, axis feed is automatically accelerated or decelerated
to avoid shock to the machine. Consequently, inaccurate thread leads are generated
where thread cutting starts and ends. These areas are referred to as incomplete
thread portions.
The incomplete thread cutting portions are calculated using the following formula.
L1 = L1 = Incomplete thread portion (at the start of thread cutting) (mm)
L2 = Incomplete thread portion (at the end of thread cutting) (mm)
L2= N: Spindle speed (min -1)
P: Lead (mm)
In actual programming, the incomplete thread portions should be taken a little larger
than the calculated lengths to avoid interference between the cutting tool and
workpiece and to allow for a margin of safety.
EXAMPLE 1