CNC
CNC
*
و قد تم ذكرهم أدناه
www.ahrars.com/teamwork
1
Contents
2
Chapter.1 : Basic Terms used in CNC Machines
1.Axis Relationships:
When points are located on a work piece, two straight intersecting lines, one
vertical and one horizontal, are used. These lines must be at right angles to
each other, and the point where they cross is called the origin, or zero point
(Fig. 1)
3
The three-dimensional coordinate planes are shown in Fig.2. The X and Y
planes(axes) are horizontal and represent horizontal machine table motions.
The Z plane or axis represents the vertical tool motion .The plus(+) and
minus(-) signs indicate the direction from zero point (origin) along the axis
motion .
2.The Y axis controls the table movement towards or away from the column.
4
A typical 3- axis machines uses three controlled axes of motion . they are
defined as the X axis , the Y axis , and the Z axis . the X axis is parallel to the
longest dimension of the machine table , the Y axis is parallel to the shortest
dimension of the table and the Z axis is the spindle movement Fig.4 on the
vertical machining center . But in horizontal milling machine the X axis is the
table longitudinal direction , the Y axis is the saddle cross direction and
the Z axis is the spindle direction as in Fig.5
5
Fig.5 Horizontal Milling Machine
6
Fig.6 The main axes of a lathe or Turning center
2.Programming Systems
Two types of programming modes, the incremental system and the absolute system,
are used for CNC. Both systems have applications in CNC programming, and no
system is either right or wrong all the time. Most controls on machine tools today are
capable of handling either incremental or absolute programming.
7
Incremental program locations are always given as the distance and direction from
the immediately preceding point (Fig. 7). Command codes which tell the machine to
move the table, spindle, and knee are explained here using a vertical milling machine
as an example:
In incremental programming, the G91 command indicates to the computer and MCU
(Machine Control Unit) that programming is in the incremental mode.
Absolute program locations are always given from a single fixed zero or origin point
(Fig. 8). The zero or origin point may be a position on the machine table, such as the
corner of the worktable or at any specific point on the workpiece. In absolute
dimensioning and programming, each point or location on the workpiece is given as a
certain distance from the zero or reference point.
• A “X plus” (X+) command will cause the cutting tool to be located to the right of
the zero or origin point.
10
3.2. Contouring Motion:
11
4. Zero Shift System :
They define the origin of the coordinate axis. They have three types:
4.2.Floating Zero (operator zero): The origin point is left for the operator to
define using a special tool, which is lowered until it touches the desired point with no
restrictions.(X & Y can take positive or negative values)
12
Revision Questions
13
Chapter.2 : Computer Numerical Control Machines
[CNC Machines]
14
2.2 Features of CNC Machines:
15
2.3.Machine Control Unit of CNC:
2.3.1 Hardware:
2.Machine interface software: is used to operate the communication link between the
CPU and the machine tool to accomplish the CNC auxiliary functions (coolant control
,tool changer ,fixture clamping device ,timers …),as previously indicated ,the I / O
signals associated with the auxiliary functions are sometimes implemented by means
of a programmable logic controller interfaced to the MCU ,and so the machine
interface software is often written in the form of ladder logic diagram
3.Application software: consists of the NC part programs that are written for
machining
16
2.4.Positioning system:
The NC positioning system converts the coordinate axis values in the NC
part program into relative positions of the tool and work part during the
processing .Let us consider the simple positioning system shown in figure
.The system consists of A cutting tool and worktable on which a work
part is fixed .The table is designed to move the part relative to the tool .
The worktable moves linearly by means of a rotating lead screw ,which is
driven by stepping motor or servomotor .For simplicity,
We show only one axis in our sketch .To provide x-y capability ,the lead
screw has a certain pitch P (in/thread , mm/thread). Thus the table moves
a distance equal to the pitch for one revolution. The velocity of the work
table ,which corresponds to the feed rate in a machining operation is
determined by the rotational speed of the lead screw
17
There are two types of positioning systems used in NC system : shown in
figure
a. open loop system operates without verifying that the actual position
achieved in the move is the same as the desired position.
Open loop cost less than closed loop systems and are appropriate when
the force resisting the actuating motion is minimal , closed loop systems
are normally specified for machines that perform continuous path
operations such as milling or turning in which there are significant forces
resisting the forward motion of the cutting tool.
18
2.5 Applications of NC & CNC:
1..Machine tool application :
• NC lathe
• NC boring mill
• NC drill press
• NC milling machine
• NC cylindrical grinding
2. Non-machine tool application:
• Welding machining
• Thermal cutting machine
2.6 Part characteristics to be Suited to Applications of NC & CNC:
1. Batch production of small to medium lot size (1-100 products)
2. Repeated order
3. Complex part geometry
4. Much metal needs to be removed
5. Part is expensive
2.7 Advantages of using NC,CNC:
1. Greater accuracy
2. Lower scrap rates
3. More complex part geometry
4. Less floor space is required
5. Operator skill level is reduced
6. Inspection requirement is reduced
19
Revision Questions:
20
Chapter.3: NC Coded Program :
3.1.Steps in program Planning :
The steps required in program planning are decided by the nature of the
work . There is no useful formula for all the jobs , but some basic steps
should be considered :
21
3.2.b Word
A program word is a combination of alpha-numerical characters , creating a single
instruction to the control system . Normally each word begins with capital letter
that is followed by a number representing a program code or actual value . typical
words indicate the axis position , feed rate , speed , preparatory commands ,
miscellaneous functions and many other definitions.
3.2.C. Block
Just like the word is used as a single instruction to the CNC system ,the block is
used as multiple instruction . A program entered into the control system consists
of individual lines of instructions , sequenced in a logical order . each line called a
sequence block is composed of one or several words and each word is composed
of two or more characters.
In the control system , each block must be separated from all others . To
separate blocks in manual data input (MDI) mode at the control , each block has
to end with a special End – Of – Block code (symbol). this code is marked by EOB
on the computer panel .When preparing the program on a computer , the Enter
key on the keyboard will terminate the block .
3.2.d Program
The part program structure varies for different controls , but the logical approach
does not change from one control to another . a CNC program usually begins with
a program number or similar identification , followed by the blocks of
instructions in a logical order . the program ends with stop code or a program
termination symbol .
22
3.3 . Format of Part Program :
Since the early days of numerical control , three formats had become
significant in their time . they are listed in the order of original
introduction:
only the very early control systems use the tab sequential or fixed formats.
both of them disappeared in the early 1970 and now obsolete. they have
replaced by the much more convenient word address format.
23
The address – the letter – in the block defines the meaning of the word and must
always be written first . for example X5.75 is correct ,5.75X is incorrect , no spaces
are allowed within a word but only allowed before the word .
Data - indicate the word numerical assignment . this value varies greatly and
depend on the preceding address. it may represent :
24
4. Preparatory Commands : G Code Description
G52 Local coordinate system setting
G Code Description
G53 Machine coordinate system
G00 Rapid positioning
G54 Work coordinate offset 1
G01 Linear interpolation
G55 Work coordinate offset 2
G02 Circular interpolation close wise
G56 Work coordinate offset 3
G03 Circular interpolation counter clock wise
G57 Work coordinate offset 4
G04 Dwell (as a separate block)
G58 Work coordinate offset 5
G09 Exact stop check – one block only G59 Work coordinate offset 6
G10 Programmable data input (data Setting) G60 Single direction position
G11 Data setting mode cancel G61 Exact stop mode
G15 Polar coordinate command cancel G62 Automatic corner override mode
G16 Polar coordinate command G63 Tapping mode
G17 XY plane designation G64 Cutting mode
G18 ZX plane designation G65 Custom macro call
G19 YZ plane designation G66 Custom macro modal call
G20 English units of input G67 Custom macro modal call cancel
G21 Metric units of input G68 Coordinate system rotation
G22 Store stroke check ON G69 Coordinate system rotation cancel
G23 Store stroke check OFF G73 High speed peck drilling cycle (deep
G25 Spindle speed fluctuation detection ON hole)
G26 Spindle speed fluctuation detection ON G74 Left hand threading cycle
G27 Machine zero position check G76 Fine boring cycle
G28 Machine zero return (reference point 1) G80 Fixed cycle cancel
G81 Drilling cycle
G29 Return from machine zero
G82 Spot drilling cycle
G30 Machine zero return (reference point 2)
G83 Peck- drilling cycle (deep hole drilling
G31 Skip function cycle)
G40 Cutter radius compensation cancel G84 Right hand threading cycle
G41 Cutter radius compensation – left G85 Boring cycle
G42 Cutter radius compensation – right G86 Boring cycle
G43 Cutter radius compensation – positive G87 Back Boring cycle
G44 Cutter radius compensation – negative G88 Boring cycle
G45 Position compensation – single increase G89 Boring cycle
G46 Position compensation – single decrease G90 Absolute dimensioning mode
G47 Position compensation – double increase G91 Incremental dimensioning mode
G48 Position compensation – double decrease G92 Tool position register
G49 Tool length offset cancel G98 Return to initial level in fixed
G50 Scaling function cancel cycle
G51 Scaling function G99 Return to R level in fixed cycle
25
3.4.1.Examples of Preparatory Commands in Milling and Drilling:
G00 Rapid Traverse: When the tool being positioned at a point
preparatory to a cutting motion , to save time it is moved along straight line at rapid
traverse , at a fixed traverse rate which is pre-programmed into the machine control
system : Format N_ _G00 __ X_Y_Z_
26
G02/03 Circular Interpolation :
27
Arc Radius
The radius is specified by Address R
N__G03 X_Y_Z_R_F_
28
29
30
31
3.4.2.Examples of G-Codes used in Turning:
32
G00 rapid traverse
When the tool being positioned at a point preparatory to cutting motion ,to save
time it is moved along a straight line at a rapid traverse , at a fixed traverse rate
which is preprogrammed into the machine control system typical traverse rate are
50 m/min ,but can be as high as 80 m/min.
Format N__G00 X_Z_
33
G02/03 Circular Interpolation
G02 moves along a CW arc , and G03 moves along a CCW arc
34
Arc Radius
Revision Questions
1. What are the steps in program planning?
2.Explain the basic terms used in CNC Programming
3.With example ,express the word address programming format ?
36
4.With sketch explain the preparatory functions in milling, drilling
operations used in:
interpolation - cutting cycles
5. With sketch explain the preparatory functions in turning operations
used in:
interpolation - cutting cycles
6. State only five of miscellaneous commands in milling ,drilling
operations?
tool path commands is to use one of the automatic software modules available
on the CAD/CAM system, these modules have been developed to accomplish a
number of common machining cycles for milling ,drilling and turning..
when the complete part program has been prepared , the CAD/CAM system can
provide an animated simulation of the program for validation purposes.
39
Computer – Automated Part Programming
Let us begin with the simplest geometric elements ,a point. The simplest way to
define the point is by means of its coordinates , for example
P4 = POINT / 35,90,0
Where the point is identified by a symbol (P4), and its coordinates are given in the
order x ,y , z In mm (x=35 mm , y = 90 mm and z=0) . A line can be define by the
two points as in the following
L1 = LINE / P1 , P2
41
Figure. Sample part with geometry elements (points, lines and circle)
labeled for computer assisted part program
where L1 is the line defined in the statement and P1 and P2 are two previously
defined points and finally a circle can be defined by its center location and radius
After the part geometry has been defined the part programmer must next
specify the tool path that the cutter will follow to machine the part .the tool
path consists of a sequence of connected line and arc segments using the
previously defined geometry elements to guide the cutter. For example suppose
we are machining the outline of our sample part in previous figure , in profile
milling operation (contouring), we have just finished cutting along surface L1 in a
counter clock wise direction around the part and the tool is presently located at
the intersection of surfaces L1 and L2 . The following APT statement could be
used to command the tool to a left turn from L1 onto L2 AND TO CUT ALONG l2
GOLFT / L2 , TANTO , C1
42
The tool proceeds along surface L2 until it is tangent to (TANTO) circle C1 . This is
a continuous path motion command.
a variety of contouring and point to point motion commands are available in the
APT language.
3.Other Functions
In addition to defining part geometry and specifying tool path the program must
also accomplish various other programming functions such as :
1. Input translation
3. editing
4. post processing
the first three tasks are carried out under the supervision of the language
processing program . for example , the APT language uses processor designed to
interpret and process the words, symbols and numbers written in APT . other
languages require their own processors .
43
The forth task post processing require a separate computer program . the
sequence and relationship of the tasks of part programmer and the computer are
shown in the following figure
44
Revision Questions:
1.What are the different methods of NC part program?
2.Briefly , explain the method of manual data input in NC program?
3. Briefly , explain the method part program using CAD /CAM method?
4.Briefly , explain the method of part program using conversation
method?
5.Briefly , explain the computer assisted part program method using for
NC part program?
6.What are the computer tasks in computer assisted part program
method?
45
Chapter.5 CNC Application Programs:
5.1 Milling and Drilling Application Programs:
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
5.2 Turning Application Programs:
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138