CNC Programing & CNC Machining 55 Pgs
CNC Programing & CNC Machining 55 Pgs
&
CNC Machining
1
Index
2
Introduction to CNC
CNC Stands for Computer Numerical Control .CNC always refers to how a machine operates
that is, its basic methods of controlling movements .Put on another way, a CNC machines
uses G-Code from computer to move motors and other positioning system in order to guide a
spindle over raw material.
A CNC machines uses mathematics and coordinates system to understand and process
information about what to move, to where, and how fast. Most CNC machines are able to
move in three controlled directions at once (called 3 axes). These directions are called axes
and given by name X, Y, Z axis (based on Cartesian coordinates System).
3
History of CNC
The first commercial NC machines were built in the 1950's, and ran from punched tape.
While the concept immediately proved it could save costs, it was so different that it was very
slow to catch on with manufacturers. In order to promote more rapid adoption, the US Army
bought 120 NC machines and loaned them to various manufacturers so they could become
more familiar with the idea. By the end of the 50's, NC was starting to catch on, though there
were still a number of issues. For example, g-code, the nearly universal language of CNC we
have today, did not exist. Each manufacturer was pushing its own language for defining part
programs (the programs the machine tools would execute to create a part).
1959 CNC Machine: Milwaukee-Matic-II was first machine with a tool changer...
A number of key developments brought CNC rapidly along during the 1960's:
- Standard G-Code Language for Part Programs: The origin of g-code dates back to MIT,
around 1958, where it was a language used in the MIT Servomechanisms Laboratory. The
Electronic Industry Alliance standardized g-code in the early 1960's.
- CAD came into its own and started rapidly replacing paper drawings and draftsmen during
the 60's. By 1970, CAD was a decent sized industry with players like Intergraph and
Computer vision, both of whom I consulted for back in my college days.
4
Introduction to CAD
It is stand for Computer aided design and it is used to translate the design into computer.
2D 2 Dimensional X, Y Axis
3D 3 Dimensional X, Y, Z Axis
CAD Software
(2D, 3D)
5
Introduction to CAM
It is Stand for computer aided manufacturing and it is used to converting CAD files
into machines Languages and these are used for CNC Programming, to generate G-Codes.
Feed, Speed, and G-
Codes Files.
CAM Software
There are numbers of these Industry in all over the
world Are famous software which are using worldwide.
MASTER CAM
DELL CAM
EDGE CAM
ART CAM
PRO-E WILD FIRE
CATIA
6
What is CNC
Computer Numeric Control
A machine which Can Perform different operation with the Help of Computer.
Types of CNC
There are different types of CNC which are used in different industry according to nature of
work in all over the world.
CNC Milling
CNC Turning/Lathe
CNC wood Router
CNC Laser Cutting
CNC Water jet
CNC wire cut
CNC EDM
7
CNC Milling machine:
A machine which can perform different operations for example Milling, Drilling, Pocketing,
Slotting, Facingetc. with the help of computer.
In this Machine Workpiece is clamped on Table which move in X & Y-axis direction while
tool is clamped in Spindle which rotate with any speed
Components of CNC:
1. Bed
2. Spindle.
3. Column
4. Saddle.
5. Lead Screw.
6. Main Control Unit (M.C.U).
7.Motors.
X-axis
Y-axis
Z-axis
8. Hydraulic Unit.
9. Pneumatic Unit.
10. Drives
X-axis
Y-axis
Z-axis
8
Types of Milling Machine
According to Structure:
9
According to Work:
Copy Milling
Universal Milling
10
Co-ordinate Systems use in CNC programming
11
Types of Cartesian Co-ordinate System
Absolute Co-ordinate System
Incremental/ Relative Co-ordinate System
12
Absolute Co-ordinate System:
A series of numerical positions that are calculated from a fixed point of origin.
All dimensions relate to the same origin, the dimension reference point.
A series of numerical positions that use the previous position as the point of
origin.
Origin point is not fix, Each point is zero point for its next point
13
Examples of Absolute & Incremental Co-ordinates
Example # 1
Absolute Incremental
G0 X10.0 Y10.0 ; G0 X10.0 Y10.0 ;
G01 X110.0 Y10.0 ; G01 X100.0 Y0.0 ;
G01 X110.0 Y60.0 ; G01 X0.0 Y50.0 ;
Example # 2
Absolute Incremental
G0 X20.0 Y20.0 ; G0 X20.0 Y20.0 ;
G01 X50.0 Y50.0 ; G01 X30.0 Y30.0 ;
G01 X150.0 Y50.0 ; G01 X100.0 Y0.0 ;
14
Polar Co-ordinate System
15
Definitions
Zero point
The point at which the three axes of a coordinate system meet. The reference zero point is
also called the origin and is located at X=0, Y=0, Z=0.
Machine zero
The position located at the farthest possible distance in a positive direction along the X-, Y-,
and Z-axes. This position is permanently set for each particular CNC machine.
Program zero
The position that acts as the origin for the part program of a particular workpiece. This
position is unique to each workpiece design, and it is selected by the part programmer.
Home position
The origin of the machine coordinate system located above the lathe spindle and to the far
upper right-hand corner of the lathe work area. The unchangeable home position is also
known as the machine zero point.
X- axis
The linear axis representing motions and positions that travel the longest distance parallel to
the worktable.
Y-axis
The linear axis representing motions and positions that travel the shortest distance parallel
to the worktable.
Z-axis
The linear axis that represents motions and positions perpendicular to the worktable. The Z-
axis is always parallel to the spindle.
16
Specification of CNC Milling
Control:
Fanuc
Hurco
Meldas
Siemens
Make:
Mitsubishi
Leadwel
Doosan
Made:
Year of Made (1960-2018)
Bed Size:
Bed Size in X & Y.
Travel In X, Y & Z
Other:
Spindle Orientation
Machine Type
Number of Axis
Spindle Speed
Feed Rate
17
Introduction to Operating Pannel
18
Introduction to G-Codes:
G Codes are instructions what are given to machine for cutting /removal of
material, machine setup etc.
A word that finds the type of operation performed on the machine for e.g.
cutting, drilling, tapping etc.
LIST OF G-CODES
1. Motion Codes:
G0 = Rapid
G1 = Linear interpolation
G2 = Circular interpolation (CW)
G3 = Circular interpolation(CCW)
2. Plane Selection Codes:
G17 = XY - Axis
G18 = YZ - Axis
G19 = ZX - Axis
3. Distance mode Codes:
G90 = Absolute Co-ordinate System
G91 = Incremental Co-ordinate system
4. Spindle Speed Mode:
G93 =
G94 =
5. Units Selection Codes:
G20/G70 = Inches
G21/G71 = Metric
6. Cutter Dia Compensation Codes:
G40 = Compensation Cancel.
G41 = Compensation Left
G42 = Compensation Right
7. Tool Length Compensation Codes:
G43 = Tool Length Compensation
G49 = Tool Length Compensation Cancel
19
8. Canned Cycle Codes:
G80 = Drilling Cycle Cancellation
G81 = Drilling Cycle
G82 = Deep Hole Drilling
G83 = Peck Drilling
G84 = Tapping Cycle
G85 ~ G89 = Boring Cycle
20
Introduction to M-Codes:
M-Codes are used for spindle turnings, coolant on/off, Program end, work piece
clamping/unclamping etc.
LIST OF M-CODES
M08 = Coolant On
M10 = Clamp On
21
Programming:
Introduction:
What is program?
A series of numerical instructions used by a CNC machine to
perform necessary sequence of operations to machine a work piece.
Programmer:
The person responsible for the creation of part program.
Program Zero:
The position that acts as an origin for the part program of specific work
piece. This position is unique for each work piece design and it is selected
by the programmer.
S-Codes:
A word that finds the spindle speed during cutting operation.
Spindle speed is s
Spindle speed = S
Unit = Rpm (revolution/min)
F-Codes:
A word that finds the feed during cutting operation. It is also known as
Feed Rate = F
Unit = mm/min
T-Codes:
A word that finds which specific cutting tool will be selected during the
tool change.
G-Codes:
A word that finds the type of an operation performed on the machine.
M-Codes:
A word used to signal an action from miscellaneous group of commands.
N-Codes:
It is a sequence number or title of program block.
22
Program Structure:
A CNC Program is made up of one or more blocks.
Block:
Each block contains one or more words.
Word:
A word is generally an address register for a value.
For e.g. BLOCK: N10 G01 X10.0 Y10.0 F100.0 M08 ;
WORDS: (N52), (G01), (X10.0), (Y10.0), (M08)
Address:
Address is a command o letter followed by a number given to the machine.
For e.g N, G, X, Y, F, M, R, S
23
How to Write a Program?
24
Milling Tools & Operations
Milling Operations:
Facing
Pocketing
Slotting
Grooving
End milling
Profile milling
Surface milling
Drilling
Boring
Reaming
Tapping
Counter sinking
Counter boring
Chamfering
25
Milling Tools
26
Examples of Linear Interpolation.
G0 & G01
Example # 1
G0 X10.0 Y10.0 ;
G01 X110.0 Y0.0 ;
Example # 2
G0 X20.0 Y20.0 ;
G01 X50.0 Y50.0 ;
X150.0 Y50.0 ;
27
Complete Program of Linear Interpolation.
Example # 1
O00001;
G0 G80 G21 G17 G49 G40 ;
S2000 M03 ;
G0 X0.0 Y0.0 ; (Touching Value)
G92 X0.0 Y0.0 ;
G0 Z0.0 ; (Touching Value)
G92 Z0.0 ;
G0 Z30.0 ;
X50.0 Y50.0 ;
G01 Z-1.0 F100.0 ;
X350.0 Y50.0 F1000 ;
X350.0 Y250.0 ;
X50.0 Y250.0 ;
X50.0 Y50.0 ;
G0 Z30.0 ;
M05 ;
M30 ;
28
Complete Program of Linear Interpolation.
Example # 2
O0002;
G0 G80 G21 G17 G49 G40 ;
S2000 M03 ;
G0 X0.0 Y0.0 ; (Touching Value)
G92 X0.0 Y0.0 ;
G0 Z0.0 ; (Touching Value)
G92 Z0.0 ;
G0 Z30.0 ;
X50.0 Y50.0 ;
G01 Z-1.0 F100.0 ;
X300.0 Y50.0 F1000 ;
X350.0 Y100.0 ;
X350.0 Y250.0 ;
X100.0 Y250.0 ;
X50.0 Y200.0 ;
X50.0 Y50.0 ;
G0 Z30.0 ;
M05 ;
M30 ;
29
Circular Interpolation
Example # 1
G0 X40.0 Y0.0 ;
G03 X0.0 Y40.0 I-40.0 J0.0 ;
Example # 2
G0 X0.0 Y40.0 ;
G03 X-40.0 Y0.0 I0.0 J-40.0 ;
G03 X-40.0 Y0.0 R40.0 ;
Example # 3
G0 X-10.0 Y35.0 ;
G03 X-40.0 Y0.0 I10.0 J-35.0
30
Complete Program of Circular Interpolation
Example # 1
31
Subprogram
A program separate from the main program that executes a series of operations
that occurs multiple times during the machining cycle. Subprograms shorten
and simplify manual programming.
G0 X0.0 Y0.0
G0 Z30.0 ;
M98 P5ooo4
32
CANNED CYCLE:
Drilling Cycle
Canned cycles are used for various drilling, boring, ramming, and tapping
functions using specified G-codes in variables of program lines.
Codes used for canned cycle are:
G80 = Canned Cycle Cancellation
G81 = For Spot Drilling Cycle
G82 = Counter Boring Cycle
G83 = Deep hole Drilling
G84 = Tapping Cycle
G85 ~ G89 = Boring Cycle
G98 = Return to Initial point
G99 = Return to Retract Point
Explanation:
G98 & G99 can be used for all canned cycles to return to the initial
point
Or retract point.
33
Example of a Drilling Program:
34
Materials
Type of Materials
I. Ferries
These are metals which contain iron. They may have small amounts of other metals or
other elements added, to give the required properties.
All ferrous metals are magnetic and give little resistance to corrosion
II. Non Ferries
These are metals which do not contain any iron. They are not magnetic and are usually
more resistant to corrosion than ferrous metals.
Pure Metals
A pure metal only consists of a single element. This means that it only has one type of atom
in it.
The common pure metals are aluminum, copper, iron, lead, zinc, tin, silver and gold.
Alloys
An alloy is a mixture of two or more metals. When a material is needed which requires
certain properties and this does not exist in a pure metal we combine metals.
Pure white aluminum is very soft and ductile. Other elements can be added to create an
aluminum alloy. This can produce a metal which is stronger than Mild Steel has improved
hardness and is resistant to corrosion while still remaining light in weight.
35
Ferrous Metals Chart
Name Composition Properties Uses
medium
carbon,
Can be hardened and tempered. Can
High Speed tungsten,
be brittle. Retains hardness at high Cutting tools for lathes.
Steel chromium
temperatures.
and
vanadium.
18%
chromium, Kitchen draining boards.
Stainless Steel Corrosion resistant
and 8% nickel Pipes, cutlery, aircraft.
added.
Low carbon
High Tensile steel,,
Very strong and very tough. Gears, shafts, engine parts.
Steel nickel,and
chromium.
0.30 % to
Medium Stronger and harder than mild steels. Metal ropes, wire, garden
0.70%
Carbon Steels Less ductile, tough and malleable. tools, springs.
carbon.
36
Non-Ferrous Metals Chart
Name Composition Properties Uses
Greyish-White, soft, malleable,
Aircraft, boats, window
conductive to heat and
frames, saucepans,
electricity, It is corrosion
Aluminium Pure Metal packaging and
resistant. It can be welded but
insulation, pistons and
this is difficult. Needs special
cranks.
processes.
Aluminium
Aluminium +4% Ductile, Malleable, Work Aircraft and vehicle
alloys-
Copper+1%Manganese Hardens. parts.
Duraluminium)
37
Properties of Materials
Hardness The resistance a materials has to cutting and surface indentations.
The length that a material can be stretched and return to its original
Elasticity
length when released.
38
Safety Precautions
1. Worker Safety
2. Machine Safety
3. Tool Safety
4. Job Safety
Worker Safety:
Clothes should not be loosed.
Ties Loose Sleeves are prohibited.
Remove the jewelry while working.
Be aware of what is going around you.
Concentrate on what you are doing.
Do not run in the workshop.
Keep the floor free of oil and Greece.
Do not attempt to measure the part that is moving.
Never Handel the chips by your hand or finger.
Light should be sufficient.
Machine door should be closed while running.
39
Tool Safety
Sharp edges or points of tools to be carried or stored, should be Protected.
Files must never be used without a handle.
Wooden handles should be renewed if they show signs of splitting.
Screwdriver blades should be kept in good condition. The correct type and size of
screwdriver should be used for the job.
Both hands should be kept behind the blade when applying pressure.
Screwdrivers should not be used as levers or chisels.
Hammerheads must be kept tightly wedged in place.
Punches or chisels that have mushroomed heads must not be used.
They must be reground.
The correct size spanner to fit the nut or bolt head should always be used.
Job Safety
Keep your finish at proper place.
It should be not strike with hard material.
Avoide the finish job from scratches.
Carefully deburn the finish job.
Be carefully about atmospheric condition for Micronics accuracy.
40
Cutter radius compensation
Cutter radius compensation allows a program to be written without considering the
size of the cutter being used.
Three G codes are used to control compensation G40, G41 and G42. They are group
modal.
G40 cutter compensation off, centre line programming.
G41 cutter compensation to the left of the programmed path.
G42 cutter compensation to the right of the programmed path.
The axes that the compensation works in are dependent on the currently active plane.
The radius used for compensation is stored in the Tool Table and the correct tool must
be active when the compensation is applied.
When compensation is active the machine calculates a tool path continuously parallel
to the programmed path.
On external corners the control will add auxiliary movements to fill the gaps left in the
parallel path. There is usually an option of whether these moves will be arcs or
intersections of the path segments. This feature is normally controlled with G codes.
On internal corners there will be profile errors where the round cutter can not get into
the sharp points.
41
It is usually possible to determine where the feedrate will apply, either at the point of
contact with the programmed profile or the tool centre. This feature is normally
controlled with G codes.
Programming moves smaller than the cutter radius usually results in either profile
errors or machine errors.
Applying compensation should be done before getting to the profile as in the example
below.
42
A) start and finish point
D) Profile
I would strongly suggest that a cycle is programmed to set the machine to a 'normal'
condition and that cycle is the first thing done in any program. As cycles vary from
control to control no further details will be put here.
43
N100 (MACHINE CUT OUT) [Program identity]
N110 (MACHINE NORMAL CYCLE GOES HERE) [Cycle to clear all switchable
conditions]
N120 T1 M6 M3 S25000 [Activate tool 1, tool change and spindle start]
N130 G54 G0 X-60 Y150 [Activate zero shift 1, rapid move to start position]
N140 Z10 [Rapid down to clearance height]
N150 G42 G1 Y180 Z-2 F3000 M8 [Activate compensation to the right at feedrate
and turn on coolant]
N160 G2 X-30 Y150 R-30 [Arc move to meet profile]
N170 G1 Y60 [Machine profile]
N230 G1 X-50
N270 G40 G1 Y150 Z10 [Cancel cutter compensation and move out of the material]
N280 G53 G0 Z0 T0 M9 [Cancel zero shift and tool, turn coolant off and retract Z
axis to machine zero]
N290 X0 Y0 [Move away from workpiece]
N300 M30 [End of program]
44
Measuring Instruments
Vernier caliper:
45
How to read the Vernier caliper:
1), Read the centimeter mark on the fixed scale to the left of the 0-mark on the vernier scale.
(10mm on the fixed caliper)
2). Find the millimeter mark on the fixed scale that is just to the left of the 0-mark on the
vernier scale. (6mm on the fixed caliper)
46
3). Look along the ten marks on the vernier scale and the millimeter marks on the
adjacent fixed scale, until you find the two that most nearly line up. (0.25mm on the
vernier scale)
4). To get the correct reading, simply add this found digit to your previous reading.
(10mm + 6mm + 0.25mm= 16.25 mm)
47
Micrometer Screw-Gauge:
The diameter of the wire is the sum of these readings: 2.5 + 0.46 = 2.96 mm
48
Height gauge:
Depth gauge:
49
Dial Indicator
50
Blueprint Reading
Types of Lines
Angel of Projection
Symbols use in Drawing
51
Types Of Line
52
53
Angel of Projection
54
Symbols use in Drawing
55