Note CNC Programming
Note CNC Programming
6 0
CO MP U TER N UM ERI C AL CO N TRO L TE C H NO LO GY
PRT 06.60
P a g e II
COURSE OUTLINE IN GENERAL
Semester 4
Weight tage 2
Hours 20 hours
ASSESSMENT SCHEME :
Page I
REFERENCES :
1. Practical CNC-Training for planning and shop-Hanser Publishers
2. Introduction to Computer Numerical Control-Barry Leathem-Jones
COURSE CONTENTS :
P a g e II
Chapter 1
Page 1
LESSON PLAN
PRT 06.60 CNC Turning & Programming 11 (ISO) Location CNC LAB
Chapter
Basic programming review
1 Prepared by MUHAMAD
RIDUAN
Objectives
4.
5.
6.
7.
8.
9.
10.
References Media
3. 3. POWER POINT
4. 4. OHP
5. 5.
Page 2
CHAPTER 1 BASIC PROGRAMMING REVIEW
The contour of a workpiece is composed of the geometric entitles lines and arc.
Programming of a line requires the path information G0 or G1 ; that of an arc, G2 or G3.
G0 (for rapid traverse) and G1 (for feed rate) are used for programming a line.
G2 (for feed rate, clockwise) and G3 (counterclockwise) are used for programming
arcs.
Program :
G0 X20 Z2 M8
G1 Z-15 F0.2
G2 X40 Z-25 R10
G1 Z-40
G3 X60 Z-50 R10
G1 Z-75
Page 3
1.2. STRAIGHT LINE AT RAPID TRAVERSE G0 AND FEED TRAVERSE G1
M instructions
Tool call-up
B instruction
Feed, R axis
Angle
Through the G0 instruction the tool (tool nose) moves at rapid traverse, i.e. with
the fastest possible speed to the target point. The tool path is determined by the
CNC control through linear interpolation; i.e. the path runs in a straight line
(shortest distance start point to target point) whereby the monitors the maximum
permissible rapid traverse speed for each axis. The rapid traverse speed may be
changed in the machine data of the CNC control.
Page 4
The target point is programmed by input of the addresses X and Z. Feed F is valid
for machines with tailstock axis R. The address T (tool call-up) should not be
used during a G0 move for indexing to another tool station, but only for “switching”
to an existing second tool nose(e.g. for a recessing tool). The G0 instruction
automatically effects a precision stop (G9). When programming G0 the (possibly
previously) programmed feed rate F remain in effect and is reactivated for example
with G1.
G0 X20 Z2 M8
Coolant
G1 Z-15 F0.2
Feed (mm/rev)
G0 X20 Z2
G1 Z-15 F0.2
G1 X40 Z-25
Page 5
1.3. CIRCULAR ARC G2 AND G3
I,K
G2 / G3 X/U.. Z/W.. P,Q.. R.. D/C.. H.. F.. E.. S.. B.. M..
M instruction
B instruction
Feed rate
Page 6
Instructions G2/G3 cause the tool (tool nose) to move the target point
clockwise/counter clockwise on a circular arc path. The start point of the
circular arc is determined through the preceding block (but could also be calculated
by the control).
The target point is programmed in the G2/G3 block with X and Z (but could also be
calculated by the control).
These are three possibilities for the input of the circular arc :
1. Programming radius R.
Note:
If radius is entered, there are two possibilities for the center point (see M1 –
M2) next page.
The control calculated only M1
Page 7
Therefore radius programming R is only permitted when the angle is smaller than
180. When equal or is greater than 180, the center point must be programmed
with P and Q or with I and K. As with G1, it is possible with G2/G3 to program a
transition chamfer D or transition radius C at the target point. Differing from G1,
here the transition radius must be called C, since the address R is already used for
the radius of the circular arc.
As with G1, there is the feed F and the (possibly reduced) feed E for transition
elements. Another address is the intersection point input H. It is required when the
start point or the target point of the circular arc is unknown.
G0 X30 Z1 M8
G1 Z-25 F0.2
G2 X50 Z-35 R10
G1 Z-55
Page 8
Example: Circular arc G2
G0 X30 Z1 M8
G1 Z-25 F0.2
or G2 X50 Z-35 P50 Q-25
or G2 X50 Z-35 I10 K0
G1 Z-55
G0 X30 Z1 M8
G1 Z-25 F0.2
G3 X50 Z-35 R10
G1 Z-55
G0 X30 Z1 M8
G1 Z-25 F0.2
or G3 X50 Z-35 P30 Q-35
or G3 X50 Z-35 I0 K10
G1 Z-55
Page 9
1.4. GEOMETRY PATHS WITH TRANSITION ELEMENTS (D/R)
P a g e 10
Important: A block with transition chamfer D (or transition radius R) must be followed
by G1 or G2/G3 in the next block for the purpose of direction identification.
This next traverse must be greater than the transition element.
G0 X0 Z1 M8 G0 X0 Z1 M8
G1 Z0 F0.2 G1 Z0 F0.2
G1 X40 D0.5 E0.1 G1 X40 R0.5 E0.1
G1 Z-30 G1 Z-30
G0 X0 Z1 M8 G0 X0 Z1 M8
G1 Z0 F0.2 G1 Z0 F0.2
G1 A100 D-2 E0.08 G1 A100 R2 E0.08
G1 X86 Z-35 A-30 G1 X86 Z-35 A-30
P a g e 11
1.5. G1 GEOMETRY PATH USING A (ANGLE) FUNCTION
The geometry processor of the TX 8F control, with help of angle A, carries out
intersection points calculations.
The machine does not work directly our of the program store, but rather out of a
buffer store. This buffer store always contains one block in advance ; i.e when
the machine carries out a move, it already “knows” what the next program block
contains.
G1 A..
G1 X.. Z.. A..
Example:
G1 A105
G1 X100 Z-50 A-30
P a g e 12
Example:
G0 X40 Z1 M8
G1 Z-25 F0.2
G1 X20 A210 F0.1
G1 A180 F0.2
G1 X60 Z-85 A-45
c) G1 Z.. A..
d) G1 A..
G1 X.. Z.. A..
S = start point
A = positive angle input
A - = negative angle input
P a g e 13
The geometry processor calculated the missing X or Z coordinate based on Angle A.
Measure angle A from the start point S. Draw a horizontal auxiliary line to the right (=0).
Measure the angle counterclockwise from this auxiliary line until you reach the leg of the
traversing travel.
This is the positive angle input.
The angle input must be in the decimal mode. Convert minutes and seconds into decimal
degrees.
20’ = 0.333 30’ = 0.5
Examples : Angle A
G1 Z-25 F0.2
G1 X20 A210 F0.1
G1 Z-65 F0.2
G1 X60 A135
P a g e 14
1.6. G2 /G3 GEOMETRY PATHS (TANGENTIAL TRANSITION)
G1 A ... G3 R..
G2 X.. Z.. R..
Known point
Note :
Radius input R may be used within the geometry path G2/G3 only with tangential transition.
If the transition is not tangential, the coordinates of the circle center point P and Q must be
programmed.
P a g e 15
1.7. G2/G3 GEOMETRY PATHS (NON-TANGENTIAL TRANSITION)
If the transition is not tangential, the line intersects the arc twice. Therefore, it is necessary
to specify the position of the intersection point H 0 or H 1. In addition, the arc center
point must be programmed with P and Q.
G1 A…
G1 A…
G2 (G3) X… Z… P… Q… H0
G2 (G3) X… Z… P… Q… H1
G3 (G2) P… Q… H0 G3 (G2) P… Q… H1
G1 X…Z… A… G1 X…Z… A…
P a g e 16
Special case:
The known point (of the line) lies within the arc. Even if there is only one intersection
point, it is necessary to specify H 0 or H 1.
Line – angle
G 1 X.. A..
or
G 1 Z.. A..
Line – line
G 1 A..
G 1 X.. Z.. A -..
Line + radius
Line –circular arc (tangential)
G1 A..
G3 (or G2) X.. Z.. R..
Arc + Line
Circular arc – line (tangential)
G2 (or G 3) R..
G1 X.. Z.. A - ..
P a g e 17
Circular arc – line H 0 (non-
tangential)
G 3 (or G 2) P.. H 0
G1 X.. Z.. A -..
Note:
The circular arcs must curve in
opposite directions.
One of them must be programmed with
center point P,Q.
P a g e 18
Chapter 2
P a g e 19
LESSON PLAN
PRT 06.60 CNC Turning & Programming 11 (ISO) Location CNC LAB
Chapter
Automatic Definition of Geometry paths
2 Prepared by Muhamad Riduan
Objectives
4.
5.
6.
7.
8.
9.
10.
References Media
3. 3. POWER POINT
4. 4. OHP
5. 5.
P a g e 20
CHAPTER 2 AUTOMATIC DEFINITION
OF GEOMETRY PATHS
G101 X… Z… I… K… A… B… R… F…
R… Radius R1
F… Feed rate
*Variant 1:
- If the first arc is defined by the radius, the second arc must be described by the
centre point coordinates I and K.
- There are only tangential transitions.
G101 X… Z… P… Q… A… B… R… F…
R… Radius R1
F… Feed rate
*Variant 2:
- If the first arc is defined by the centre point coordinates P and Q, the second arc
must be described by the radius.
- There are only tangential transitions.
P a g e 21
2.2. G102 GEOMETRY PATHS 1, FACE
G102 X… Z… I… K… A… B… R… F…
R… Radius R1
F… Feed rate
*Variant 1:
- If the first arc is defined by the radius, the second arc must be described by the
centre point coordinates I and K.
- There are only tangential transitions.
G102 X… Z… P… Q… A… B… R… F…
R… Radius R1
F… Feed rate
*Variant 2:
- If the first arc is defined by the centre point coordinates P and Q, the second arc
must be described by the radius.
- There are only tangential transitions.
P a g e 22
2.3. G105 GEOMETRY PATHS 2, LONGITUDINAL
G105 X… Z… I… K… A… B… C… R… F…
R… Radius R1
F… Feed rate
*Variant 1:
- If the first arc is defined by the radius, the second arc must be described by the
centre point coordinates I and K.
- There are only tangential transitions.
G105 X… Z… P… Q… A… B… C… R… F…
R… Radius R1
F… Feed rate
*Variant 2:
- If the first arc is defined by the centre point coordinates P and Q, the second arc
must be described by the radius.
- There are only tangential transitions.
P a g e 23
2.4. G106 GEOMETRY PATHS 2, FACE
G106 X… Z… I… K… A… B… C… R… F…
R… Radius R1
F… Feed rate
*Variant 1:
- If the first arc is defined by the radius, the second arc must be described by the
centre point coordinates I and K.
- There are only tangential transitions.
G106 X… Z… P… Q… A… B… C… R… F…
R… Radius R1
F… Feed rate
*Variant 2:
- If the first arc is defined by the centre point coordinates P and Q, the second arc
must be described by the radius.
- There are only tangential transitions.
P a g e 24
Chapter 3
Canned Cycle
P a g e 25
LESSON PLAN
PRT 06.60 CNC Turning & Programming 11 (ISO) Location CNC LAB
Chapter
Canned Cycle
3 Prepared by Muhamad Riduan
Objectives
2. Write and explain the basic programming technique using canned cycle of
CNC turning.
4.
5.
6.
7.
8.
9.
10.
References Media
3. 3. POWER POINT
4. 4. OHP
5. 5.
P a g e 26
CHAPTER 3 CANNED CYCLE
Generally, several roughing passes are required before the workpiece is ready for finish
cutting. If the roughing cuts are programmed as single blocks, the calculations are rather
complicated. The TX8F features several cycles that execute these geometry
calculations automatically.
The finished contour for the roughing cycle can be programmed in two ways:
1. The finished contour towards which roughing is performed is stored in the main
program. Contour start and end are always marked by a block number. The
block number for the contour end must always be greater than that for the
contour start. A block number must never exist in duplicate.
If the roughing cuts are to be executed with tool nose radius compensation (TRC),
„G46‟ must be programmed in the finish contour. Then the control takes over the
quadrant (P) and the tool nose radius from the tool data file.
N60 G40
:
P a g e 27
When defining the finished contour, the first block must be a traverse motion
(G0 or G1 in both axes (X.. and Z..) to the start point of the finished contour.
From the position of the start point and end point the control recognized the
start point for roughing outside or roughing inside.
G70 Longitudinal Contour Roughing Cycle for Tools with Approach Angle J 90
Application: The longitudinal roughing cycle G70 is used when tools with an
approach angle smaller than 90 are employed.
P a g e 28
G70 A.. P.. Q.. I.. K.. D.. J.. F.. S..
Spindle speed or
cutting speed
Feed rate
Depth of cut
P a g e 29
Example with G70:
(ROUGHING)
G96 V160 T101 M04
G0 X90 Z5
G70 P50 Q60 10.8 K.0.1 D6.33 J73 F0.4
G26
(FINISHING)
G96 V180 T505 M04
N50 G46
G0 X25 Z5
G1 Z-36 F0.15
G1 X24.4 A210 F0.1
G1 Z-40 F0.15
G1 X65 R5 E0.1
G1 Z81
G1 X64.4 A210 F0.1
G1 Z-85 F0.15
G1 X90
N60 G40
G26
M30
P a g e 30
3.3. G71 LONGITUDINAL CONTOUR ROUGHING CYCLE
Application: The longitudinal roughing cycle G71 is used for external and
internal machining.
P a g e 31
This reduced feed rate is programmed under the address E.
If no value is entered under E, the control automatically uses the feed rate value
programmed under F. After completion of the roughing cycle on a descending contour
section, the tool is automatically retracted. The retract distance (lifting travel) is to be
set as parameter with a value of max. 99.999 mm in TOOL/PARAM H7 menu H3
= set up 1 # 15 G71 retraction.
If the infeed for the last roughing cut is smaller than the set parameter value min.
cutting depth, the last roughing cut is executed with this parameter value. It is defined
in TOOL/PARAM H7 menu H3 = set up 1 # 13 small allowance.
The modified cutting depth for the preceding roughing cuts is automatically recalculated
by the control.
Example:
(ROUGHING)
G96 V160 T0404 M4
G0 X100 Z2
G88
G71 P50 Q60 I0.5 K0.05 D4 F0.35 E0.12
89
G26 M9
(FINISHING)
G96 V200 T0505 M4
N50 G46
G0 X26 Z1 M08
G1 X30 D2 F0.15 E0.1
G1 Z-15
G1 X65 R5
G1 Z-45
G1 X38 A205 F0.1
G1 Z-120 R6 F0.15
G1 X100 D2
G1 W-4
N60 G40
G26 M09
M30
P a g e 30
Example: using G88 and G89
(ROUGHING)
G96 V150 T2020 M08
G0 X30 Z2
G88
G71 P51 Q61 I0.5 K0.1 D3.5 F0.25 E0.1
G89
G27
(FINISHING)
G96 V180 T404 M04
N51 G46
G0 X120 Z1.5
G1 A270 R10 E0.1
G1 X70 Z-35 A20
G1 X60
G1 Z-62
G1 U0.3 A150 F0.08
G1 Z-65 R0.6
G1 X40
G1 Z-75
G1 X29
N61 G40
G27
M30
P a g e 31
3.4. G72 FACE CONTOUR ROUGHING CYCLE
Feed rate
Depth of cut
The face roughing cycle G 72 is used for outside and inside machining.
If the finished contour contains a descending contour section, the rough-turning operation
will be programmed with G 88 before G 72, but ignored by programming G 89 before G 72.
Machining of the descending contour section must be suppressed with G 89 in cases where
the form of the roughing tool is not suitable for the operation.
For machining a descending contour section
it is possible to reduce the feed rate.
This reduced feed rate is programmed
under the address E.
P a g e 32
If there is no input for E, the control automatically uses the feed rate value programmed for
F. After completion of the roughing operation of the descending contour section, the tool is
automatically retracted for the shoulder.
The lifting travel can be set as a parameter (SET UP – pattern 6 #9) with a value of 999
max.
If the infeed for the last roughing cut is smaller then the set parameter value “minimal cutting
depth” (SET UP –pattern 6 #6), then the last roughing cut is executed with that parameter
value. The changed cutting depth for the preceding roughing cuts is automatically
recalculated by the control.
.....
….
(Roughing)
G96 V100 T0505 m4
G0 X145 Z1 M8
G88
G72 P70 Q80 I0.1 K0.5 D3 F0.3 E0.1
G89
G26 M5 M9
.....
….
(Finishing)
G96 V120 T0808 M4
N70 G46
G0 X142 Z-35 M8
G1 X100 R10 F0.2 E0.1
G1 Z-8 D1
G1 X80
G1 Z-16 A245 F0.1
G1 X25 R5 F0.15
G1 Z0.5 D2
G1 U-3
N80 G40
G27 M5 M9
.....
….
M30
P a g e 33
Example : G 72 – Face contour roughing cycle (internal)
.....
….
(Roughing)
G96 V100 T0505 m4
G0 X30 Z2 M8
G89
G72 A520 I0.1 K0.5 D3 F0.3 E0.1
G27 M5 M9
..... sub-routine
…. finishing contour
roughing cycle
(Finishing)
G96 V120 T0808 M4 O520
G46 G46
G0 X150 Z1 M8 G0 X33 Z-40
G1 Z0 F0.2 G1 X85
G1 X140 R3 E0.1 G1 Z-25
G1 Z-12 G1 A90
G1 X110 G1 X110 Z-12 A220
G1 Z-25 A220 G1 X140
G1 X85 G1 Z0 R3
G1 X150
G1 Z-37
G40
G1 X85.6 A150 M99
G1 Z-40 R0.6
G1 X34
G40
G27 M5 M9
.....
….
M30
P a g e 34
3.5 G83 DEEP HOLE DRILLING CYCLE
Feed rate
Number of relief cycles
For remaining drilling depth
First drilling depth
Note :
a = Safety distance for rapid traverse.
The safety distance is set in SET UP – pattern 6 #7 (free parameter data 2) as
a parameter with up to max. 999
P a g e 35
Example : G83 – Deep hole drilling cycle
Deep drilling cycles are necessary for holes that are deeper than three times the diameter.
Before call-up of G83 it is necessary to approach the start point in rapid traverse G 0 or feed
G1. The first drilling depth is programmed under address D with reference to the start point.
The remaining drilling depth is divided into equal distances by input of address H ( number
of relief cycles).
Note :
- Used for concentric and eccentric holes (with rotating tools)
- The drill cycles G 83 and G 84 may also be used for cross holes (with driven tools). In
that case the target point is programmed with X rather than with Z.
P a g e 36
3.6. G76 THREAD CHASING CYCLE
Thread pitch
F : 3 digits after decimal point
E : 5 digits after decimal point
Depth of thread
P a g e 37
Cylindrical or tapered outside and inside thread can be produced with the thread
chasing cycle G 76. The input of angle J for tapered threads is limited to +/- 45
degrees. I.e. the feed (pitch) is referenced to the Z axis.
Prerequisite is a spindle speed (G 97 S..) on the main spindle as well as a fed
(pitch) in mm/rev (G95). Before stating G 76, a start point in the X and Z axis must
be approached. This start position and the X position programmed in the cycle is
used by the control to compare inside and outside threads.
The start position in the Z axis must be selected so that the tool reaches the preset
containing rate (spindle speed x feed rate) before it starts the actual cutting
operation. Also, the brake condition of the feed drives must be taken into
consideration. The control automatically divided the individual cuts in the cycle G 76
with consideration of the thread depth programmed with K and the number of
passes programmed with H. For this division the last infeed (programmed under
address D) is taken into consideration.
The infeed in the G 76 cycles occurs at an angle (programmed under address A) up
to the max. flank angle.
P a g e 38
Example : G 76 – Thread chasing cycle
P a g e 39
3.7. G82 TAPPING CHASING CYCLE
G 82 Z / W… F… S…
Spindle speed
Thread pitch
The threading cycle G82 may be used for tapping or threading with tap and dies.
Prerequisite is a spindle speed (G97 S….) on the main spindle as well as a feed rate
(thread pitch) in mm/rev (G95).
* The feed rate must be (depending on pitch and spindle speed) up to 20% less than
the pitch (floating tool holder).
P a g e 40
Chapter 4
P a g e 41
LESSON PLAN
PRT 06.60 CNC Turning & Programming 11 (ISO) Location CNC LAB
Objectives
4.
5.
6.
7.
8.
9.
10.
References Media
3. 3. POWER POINT
4. 4. OHP
5. 5.
P a g e 42
CHAPTER 4 SUB-ROUTINE AND PARAMETRIC
PROGRAMMING TECHNIQUES
Number of successive
sub-routine repetitions
Call-up of sub-routine
No. 8000 – 8999 : user sub-routines
No. 9000 – 9999 : TRAUB sub-routines
For workpiece with identical program sections or identical contour segments, such
repetitious program sections and contour segments can be programmed as sub-
routines (e.g. recesses, part families).
When needed, they are called up with a G 22 instruction from the main program.
A determines which sub-routine should be called up (see example 1).
If the sub-routine designated with A is used only partially rather than entirely (for
example, between two certain block numbers), P and Q are used (see example 2).
Examples 3 and 4 show section from the sub-routine or main program (from No. P
or to No. Q)
H determines how often the sub-routine or the program segment should be
executed.
If H is not programmed, the sub-routine becomes effective through G 22 and is
executed once (acts like H 1).
Note:
- Every program may be used as a sub-routine as long as it is closed with M 99.
- Sub-routines may be tiered (nested) up to eight times (see example 6).
P a g e 43
Example 1 :
Example 2 :
Example 3 :
Example 4 :
Example 5 :
Example 6 :
P a g e 44
4.1.2. SUB-ROUTINE TECHNIQUE
Example 1:
The same axial hole diameter 11 mm and thread M12 x 1 are to be produced on
several workpieces. A subroutine is programmed for these operations. The
subroutine must end with M99 = subroutine end.
Subroutine program
%
O8000
(Centering)
N3 G97 S1=1000 T0303 M3
G0 X0 Z1 M8
G1 Z-6 F0.1
G4 X1
G27 M5 M9
(Drilling core hole)
N4 G97 S1=800 T0404 M3
G0 X0 Z1 M8
Call-up in main program
G1 Z-25 F0.1
G4 X1 O12345
P a g e 45
Example 2:
When performing complete machining using driven tools, it often happens that a
certain section of the main program must be repeated.
Main program
%
O5789
G59 X0 Z200
….
….
….
N3 T0303 M5
G94 S3=1000 M303
G0 X30 Z2 M8
N100
…. Drilling 1 hole
…. and positioning
…. Main spindle by 90
….
N200
G22 P100 Q200 H3 (repeat three times)
….
….
M30
%
P a g e 46
4.2 GENERIC SUBROUTINES
General
The subroutines describes so far are programmed so far are programmed with
definite numerical values (e.g. 20 mm thread depth or hole circle 30mm). It is
also possible to omit such numerical values and to determine them for each
individual case when calling up the subroutine. Subroutines where certain values are
not fixed, are called GENERIC SUBROUTINES.
Instead for numerical values, parameter from the L parameter memory are used.
Prior to calling up the subroutine, these L parameters are replaces by the correct
numerical values.
Prior to this, the valued must be assigned to the parameters in the main program :
L1 = 20 value assignment
L2 = 25 value assignment
G 22 A… subroutine call-up
The parameters can also be combined with each other by calculation functions:
L 2 = [L1 + 5] (see calculation functions)
P a g e 47
Instructions for creating a generic subroutine
Note:
If the values are to be calculated by the control, they must be put in
square bracket (see calculation function).
%
O8007
(Centering)
N3 G97 V30 XL2 T0303 M3
G0 X0 Z1 M8
G1 Z-[L2/2] F0.1
G27 M5 M9 Call-up and value assignment in main
(Drilling core hole) program.
P a g e 48
Survey :
+ + addition L 1 = [5 + 3]
- - subtraction L 2 = [3 - 1.5]
X * multiplication L3=[4*0,5]
: / division L4=[12/3]
P a g e 49
4.3. MACRO CALL-UP G 201 TO G299
With the instruction G 201 to G 299 it is possible to activate a certain work sequence
as simply as with a cycle. This “definite work sequence” is programmed as a generic
subroutine; its values are defined (as in a cycle) through the addresses A to Z,
e.g. G201 A.. B.. C.. (for possible addresses see table).
Macros are used wherever standard processes require various sets of dimensions
(e.g. bar stop, plug cut of grooves, gauging, etc.). The pertinent sub-routine is
automatically is activated by the control through the macro call-up.
In this sub-routine the control does not operate with addresses A to Z, but rather with
the pertinent L-parameters L 501 to L 522 (see table).
The relationship between macro call-up and the applicable sub-routine can be seen
from the diagram shown below.
Address Parameter
Relationship of macro call-up A L501
and applicable cub-routine. B L502
C L503
D L504
Macro call-up
E L505
Main program F L506
H L507
….. I L508
….. J L509
Sub-routine program. K L510
…..
M L511
G231 A.. B.. C.. O9831
P L512
….
….. Q L513
….
….. …. R L514
….. …. S L515
…. T L516
M30 ….
U L517
….
M99 V L518
W L519
X L520
Note: Y L521
Since work-connected macros (from TRAUB) already Z L522
exist or being produced, customers may use only
Addresses G – L – N – O
are not possible.
call-ups G251 to G299.
P a g e 50
Instructions for creation of Macros
Note:
- With enough practice and experience it is possible to skip Step 2 (program
concept).
- The addresses G (like G-function), L (like parameters), N (like block
numbers), and ) (like program) must not be used.
Example : Groove plunging G 248 S.. X.. Z.. B.. D.. F.. W.. T..
Sequence:
Center plunge
Left plunge
Right plunge
S = start diameter
X = target point diameter
Z = target point length
B = groove width
D = chamfer
F = feed in mm/rev
W = tool width
T = tool ATC left
P a g e 51
Example Macro program: (Groove plunging)
T[T] %
G0 Z -[Z-[B-W]/2] 0 9848
G0 X [S + 2] T L 516
G1 X [X+0.1] F[F] G0 Z-[L522-[L502-L519]/2]
G0 X [S+1] G0 X[L515+2]
G0 Z -[Z+ D+ 0.5+ 0.7] G 1 X[L520+0.1] FL506
G1 Z-[Z] D[D+0.5] E[F/2] G0 X[L515+1]
G1 X [X] G0 Z-[L522+L504+0.5+0.7]
G1 Z-[Z-0.1] G1 Z-L522 D[L504+0.5] E[L506/2] G 1 XL520
G0 X[S+1] G1 Z-[L522-0.1]
T [T + 2020] G0 X[L515+1]
G0 Z -[Z- B - D-0.5-0.7] T [L516 + 2020]
G1 Z-[Z-B] D[D+0.5] G0 Z -[L522- L502 - L504- 0.5 - 0.7]
G1 X [X] G1 Z-[L522-L502] D[L504+0.5]
T[T] G 1 X L 520
G1 Z -[Z-0.05] T L 516
G 1 X [S + 2] G 1 Z -[L522 - 0.05]
G0 X[L515+2]
Call-up in the main program M99
%
%
O2525
G59 X0 Z150
….
….
(plunge cutting)
N4 G96 V100 T0404 M8
(1ST plunging)
G248 S30 X20 Z15 B4 D0.5 F0.1 W3 T0404
G0 X52
(2ND plunging)
G248 S50 X40 Z40
(3RD plunging)
G248 Z55
G26 M9
….
….
M30
%
P a g e 52
Example Macro program: (external turning)
Parameter list:
T = tool call-up for roughing
U = tool call-up for finishing
F = feed in mm/rev
%
O9885 (Program concept)
G26
G96 V100 T [ T ] M4
G0 X[ M+5 ] Z0
G1 X-1 F[ F ] Z2
G0 X[M+5] Z2
G88
G71 P10 Q20 I0.5 K0.1 D2 F[ F*2 ] E [ F*0.5 ]
G89
G26 M5 M9
G96 V120 T[ U ] M4
L1 = [ [ TAN A * H ] * 2 ]
L2 = [ B – L1 – 2 ]
G0 X L2 Z2
N10 G46
G0 X L2 Z2
G1 Z0 F [ F ] M8
G1 A90
G1 X [ B ] Z [ H ] A - [ A ]
G1 Z- [ K ]
G2 X [ E ] Z [ J ] R [ R ]
G1 Z- [ P ]
G1 X [ M ] D [ D ]
G1 W- [D+2 ]
N20 G40
G26 M6 M9
M99
%
P a g e 53
Application the macro program in the main program:
O223344
%
G59 X0 Z200
G92 S2000 Q1000
G26
…
…
G285 A30 B60 D5 E100 H25 J75 K38 M150 P108 R50 T0101 U0202
…
…
M30
P a g e 54
Chapter 5
Driven Tools
P a g e 55
LESSON PLAN
PRT 06.60 CNC Turning & Programming 11 (ISO) Location CNC LAB
Chapter
Driven Tools
Objectives
2.
3.
4.
5.
6.
7.
8.
9.
10.
References Media
3. 3. POWER POINT
4. 4. OHP
5. 5.
P a g e 56
CHAPTER 5 DRIVEN TOOLS
P a g e 57
5.1.3 MILLING WITH SAWBLADES AND SIDE-AND-FACE CUTTERS
Slots can be machined with saw blades in cross or plunge milling operations.
In combination with spindle positioning, it is possible to produce multi-edges
faces. Efficiency can be increased with use of paired cutters. Through
simultaneous X and Z movement slots with curved bottom surfaces san be
produced.
Radial slotting with slide-and-face Milling of flats and slot with side –
cutter. and-face cutters (straight milling).
P a g e 58
5.2. PRODUCTION METHOD USING SPEED-CONTROLLED AND POSITION-
CONTROLLED WORK SPINDLE (C AXIS).
P a g e 59
5.3. SURVEY OF DRIVING POSSIBILITIES
Driven tools can be mounted in each of the 12 tools station, with one exception:
- If the machine is provided with an in-process gauging control, station 11 of the tool
carriers W1 and W2 cannot be equipped with driven tools.
P a g e 60
5.4 CALL-UP IN NC PROGRAM
Tool carrier
- Caution :
When determining the spindle speed, a transmission ratio must be taken into account
for some toolholders.
- The direction of rotation of the driven tools is specified as viewed from the tools
drive.
Caution :
For some toolholders (for driven tools) the direction of rotation is reversed by an
intermediate pinion in the holder.
Important:
Prior to the T call-up, the tool drive must be switched OFF!
P a g e 61
Example for calling up a driven tool:
Tool carrier
N6 T 606 M5 / M 205
G94
S3 = 1500 M303 / M304
M 305
When cutting threads by means of driven tools with the main spindle being
stopped, the thread must be programmed in G1 format.
P a g e 62
Chapter 6
P a g e 63
LESSON PLAN
PRT 06.60 CNC Turning & Programming 11 (ISO) Location CNC LAB
Chapter
C Axis – and milling functions
Objectives
2. Understand and write the programming format of C – axis and milling at the
CNC turning machine.
4.
5.
6.
7.
8.
9.
10.
References Media
3. 3. POWER POINT
4. 4. OHP
5. 5.
P a g e 64
Chapter 6 C – AXIS AND MILLING FUNCTION
POLYFORM
P a g e 65
6.1 C AXIS INSTRUCTIONS
Input C0
G 00 – Rapid traverse
G 01 – Feed rate
feed rate
By using the C axis, drilling and milling operations can be performed (positioned on
the workpiece) in addition to turning operations.
The feed rate is entered in mm/min (G94). It can, however, be converted into
degrees/min by means of the macro G261 (see next page).
P a g e 66
The C axes of the main spindle or the opposed spindle can both be defined in the
slide $1 program and the slide $2 program.
Caution :
- Before programming M17/M217, the main spindle and the opposed spindle,
resp, must be stopped by M 5/M 205.
- During C axis mode, no. M 5/ M 205 and no speed S1/S2 must be
programmed.
If a zero point shift takes place in the C axis by means of the instruction G59 C.., it
will be modified only be programming a new zero point shift.
Therefore, the zero point shift must be reset by G59 C0 at the end of the C axis
mode.
Caution :
- When traversing at feed rate, the feed rate of the C axis must be calculated in
“degrees per minute”.
P a g e 67
A macro is available for the feed calculations of traverse movements with the C axis.
In this macro (G261) the feed rate is calculated, taking into account the machining
diameter and the number of degrees to be traversed.
Within the machining program, the feed rate stored in parameter L3 or L4 can be
programmed under the address F.
Macro :
%
09861
L3 = FUP [[360/[L504 *3.14]] * [L506 * L522 *L502]]
L4 = FUP [L506 * L522 * L502]
M99
%
P a g e 68
6.2 C AXIS SELECTION ON THE MAIN SPINDLE
Absolute programming
M5 spindle stop
M17 C axis ON
G 28 C0 Approach to reference point C axis
G90 selection absolute programming
G94 feed rate mm/min
workpiece program
G95
M18 C axis OFF
M5 spindle stop
M17 C axis ON
G28 C0 Approach to reference point C axis
G91 selection incremental programming
G94 feed rate mm/min
workpiece program
G90 selection absolute programming
G95
M18 C axis OFF
P a g e 69
6.3 C AXIS PROGRAM FORMAT
Below you will find the program format including the G3 block and details concerning
this block.
G90
G94 mm/min
M17 C AXIS ON
G11 MILLING ON
G0 X61 Y0
X = calculated value
Y = width across flats
P = centre X axis
A = centre Y axis
R = radius
F = feed rate
P a g e 70
C axis
Programming example :
P a g e 71
C axis
Programming example :
On main spindle
Note : The centre point of an arc to be milled must lie on the spindle centre
line.
P a g e 72
6.4. POLYFORM INSTRUCTIONS (TRAUB MACHINE CONTROLLER)
The instruction G17 selects the plane face. The traverse movements are
programmed under the addresses X and Y (see coordinate system). If the input is
made on the machine, the key Y must be pressed; this superimposes the address C.
X+
Z- Z+
X-
Coordinate system MILLING
Y+ Z+
X- X+
Z- Y-
P a g e 73
G17 – Milling plane face / traverse cut
The instruction G17 selects the plane face / transverse cut. Programming of the
traverse movements takes place under the addresses Y and X. If the input is
performed on the machine, key Y must be pressed. This superimposes the address
C. A movement in the Z axis (infeed) must be programmed as a separate block.
After selection of G17, the following G functions are permissible:
P a g e 74
Coordinate system and workpiece zero point when POLYFORM milling in the
G17 plane (face).
N9 T909 M5
G94
M17
M303 S3=600
G90
G0 X46 Z-3
G11
G17
G3 X19,621 Y12 P0 A0
F1000
G1 X-20 F100
G10
G0 X60
G26 M305
M18
G95
P a g e 75
G17 plane (face)
Programming example : to mill Square
N3 T303 M5
G94
M17
M303 S3=500
G90
G0 Z-5
G0 X33.5
G11
G17
G3 X-11.15 Y12.5 P0 A0
F1000
G1 X-12.5 F100
G1 Y-12.5
G1 X12.5
G1 Y8
G10
G0 X60
G26 M305
M18
G95
P a g e 76
Example : Milling a square profile with a 20mm width AF. Material and milling
cutter diameter are the same as for the flat rate.
P7 P3
P4
P8
P1
P2
P5 P6
P a g e 77
Width AF = 20mm
Milling cutter diameter = 30mm
P7 P3
P4
P8
12mm
20mm
P1
P2
P5 P6
30mm
A
B = comp. positioning in X after the calculation aid G11, milling plane G17 and
MRC with G = radius
P a g e 78
(G3 with known coordinate) G3 with unknown coordinate
T0101 M5 T0101 M5
M303 S3=3000 M303 S3=3000
G94 G94
M17 M17
G28 C0 G28 C0
G90 G90
G0 Z-5 G0 Z-5
G0 X46 G0 X46
G11 G11
G17 G17
G42 G42
G0 X17 Y0 G0 X17 Y0
G3 X13.748 Y10 C0.1 F3000 E100 G3 P0 A0 H1 C0.1 F3000 E100
G1 X-10 F100 G1 X-10 Y10 A0 F100
G1 Y-10 G1 Y-10
G1 X10 G1 X10
G1 Y10 G1 Y10
G0 X16 A90 G0 X16 A90
G40 G40
G10 G10
M18 M18
G95 G95
G26 M25 G26 M25
P a g e 79
Example : Milling a hexagon profile with a 20mm width AF. Material and milling
cutter diameter are the same as for the square.
Material diameter 30 mm
Milling cutter diameter 12 mm
Safety distance 2 mm
Width AF 20 mm
12mm
20mm
P1
P2
30mm
A
P a g e 80
Intersection points H0 / H1
T0101 M5 T0101 M5
M303 S3=2000 M303 S3=2000
G94 G94
M17 M17
G28 C0 G28 C0
G90 G90
G0 Z-5 G0 Z-5
G0 X46 G0 X46
G11 G11
G17 G17
G42 G42
G0 X17 Y0 G0 X17 Y0
G3 X13.748 Y10 P0 A0 C0.1 G3 P0 A0 H1 C0.1 F3000 E100
F3000 E100
G1 X-5.774 F100 G1 X-5.774 Y10 A0 F100
G1 Y0 A240 G1 X-11.547 Y0
G1 X-5.774 A300 G1 X-5.574 Y-10
G1 X5.774 G1 X5.574
G1 Y0 A60 G1 X11.547 Y0
G1 X5.774 A120 G1 X5.574 Y10
G1 X5.574 G1 X5.574
G0 Y16 A180 G0 Y16 A180
G40 G40
G10 G10
G95 G95
M18 M18
G26 M25 G26 M25
P a g e 81