Professional Documents
Culture Documents
Computer Aided Manufacturing Part 1
Computer Aided Manufacturing Part 1
NC – Numerical Control
CNC – Computer Numerical Control
DNC – Direct Numerical Control
APT – Automatic Programmed Tool
CAD – Computer Aided Design
CAM – Computer Aided Manufacturing
CIM – Computer Integrated Manufacturing
3
2. Advantages of a CNC Machine
Higher flexibility: This is essentially because of
programmability, programmed control and facilities
for multiple operations in one machining centre,
Increased productivity: Due to low cycle time
achieved through higher material removal rates and
low set up times achieved by faster tool positioning,
changing, automated material handling etc.
Improved quality: Due to accurate part dimensions
and excellent surface finish that can be achieved due
to precision motion control and improved thermal
control by automatic control of coolant flow.
4
Advantages of a CNC Machine Cont’d
5
Advantages of a CNC Machine Cont’d
• Smaller footprint: Due to the fact that several machines are fused
into one.
6
3. The main disadvantages of NC systems
7
4. How CNC Works
8
5. Features of CNC Machine
9
6. Tools
10
7. Basic Machine Axes: 3 axis
Coordinate System
Units, incremental or absolute positioning
Coordinates: X,Y, Z,
Feed rate and spindle speed
Coolant Control: ON/OFF, Flood, Mist
Tool Control: Tool and Tool parameters
10. CNC programming
15
11. Basic Requirement of NC
Machine Control/ NC Program
• Preparatory functions: which unit, which interpolator, absolute or incremental
programming, which circular interpolation plane, cutter compensation, etc.
• Coordinates: three translational, and three rotational axes.
• Machining parameters: feed, and speed.
• Tool control: tool diameter, next tool number, tool change.
• Cycle functions: drill cycle, ream cycle, bore cycle, mill cycle, clearance
plane.
• Canned cycles: are a set of pre-programmed instructions permanently
stored in the machine controller that automate many of the required
repetitive tasks. eliminates the need for many lines, reduces the
programming time and simplifies the whole programming process.
• Coolant control: coolant on/off, flood, mist.
• Miscellaneous control: spindle on/off, tape rewind, spindle rotation direction,
pallet change, clamps control, etc.
• Interpolators: linear, circular interpolation 16
12. Programming Key Letters/Symbols Used
(7.000,2.000)
(5.000,2.000)
22
NC WORDS Cont’d
2. Helical Interpolation
• Command G02 or G03 with a designation for the third axis allows
synchronous circular interpolation on the plane specified by plane-
selection command G17, G18 or G19 with the linear interpolation on the
axis.
• Designating the two axis addresses for circular interpolation and
the address of one axis for linear interpolation.
Programming Format:- • X = Arc ending point
G17 G02 (or G03) X _ Y I J P F ; coordinates X axis
or • Y = Arc ending Point
G17 G02 (or G03) X Y R P F ; coordinates Y axis
• I & J = Arc center
Example:- Coordinates
G28 U0 W0 G50 X0 Y0 Z0 • P = Number of pitches
G17 G03 X0 Y0 Z20 R5 F1000. • F = Feed rate
• R = Arc Radius
23
NC WORDS Cont’d
2. Helical Interpolation
• Corresponding selection of interpolation plane
Plane Type of Target point Target point Center /radius Pitch
Interpolation in plane on helical axis
G17 G02/G03 X..Y.. Z.. I..J../R K
G18 G02/G03 Z..X.. Y.. K..I../R J
G19 G02/G03 Y..Z.. X.. J..K../R I
Example
• Helical interpolation clockwise in plane XY with
following helix:
Starting point a: X0 Y0 Z0
Target point b: X0 Y0 Z20
Helix center I, J: (5,5)
Helix pitch K: 26,66 (from table)
N10 G17 G90 X0 Y0 Z0 F500
N20 G03 X0 Y0 Z20 I5 J5 K.
NC WORDS Cont’d
2. Helical Interpolation
Programmed Helix rotation from Corrected
pitch K (in mm) a to b pitch K (in mm)
17,5 ¾ 26,66
16 1¾ 11,4
15 1¾ 11,4
12,5 1¾ 11,4
10 1¾ 11,4
7,5 2¾ 7,27
5 3¾ 5,33
2,5 7¾ 2,58
2 9¾ 2,05
1 19¾ 1,01
Programming Format:-
G40=Tool radius compensation mode cancel
G41=Tool radius compensation left mode ON
G42=Tool radius compensation right mode ON
Cutter Diameter Compensation Cont’d
The advantage of the CDC feature is that it:
• Allows the use of cutters that have been sharpened to a
smaller diameter.
• Permits the use of a larger or smaller tool already in
the machine’s storage matrix.
• Allows backing (support) the tool away when
roughing cuts are required due to excessive material
present.
• Permits compensation for unexpected tool or part
deflection, if the deflection is constant throughout the
programmed path.
Cutter Diameter Compensation Cont’d
Figure 23. Cutter-Diameter compensation must be used when
machining with various size cutters.
17. Block of Information
• CNC information is generally programmed in blocks of five
words.
• Each word conforms to the EIA standards and they are written
on a horizontal line. ( EIA, Electronic Industries Alliance, an
American standards)
• If five complete words are not included in each block, the
machine control unit (MCU) will not recognize the information;
therefore the control unit will not be activated
37
The following illustration shows a typical NC
block and its components Cont’d
38
Cont’d
• The most common codes used when programming
CNC machines tools are;-
G-codes - preparatory functions
M codes - miscellaneous functions
Other codes such as F, S, D, and T are used for machine
functions such as feed, speed, cutter diameter offset,
tool number, etc.
• Each block, or program line, contains addresses which
appear in this order:
N-G-X-Y-Z-F-M-S-T
This order should be maintained throughout every
block in the program, although individual blocks may
not necessarily contain all these addresses. 39
Figure 6. Structure of a block in a part program Cont’d
40
18. Sub Program
41
19. Basic List of ‘G’ Operation Codes
G00 - Rapid move (not cutting)
G01 - Linear move
G02 - Clockwise circular motion
G03 - Counterclockwise circular motion
G04 - Dwell
G05 - Pause (for operator intervention)
G08 - Acceleration
G09 - Deceleration
G17 - x-y plane for circular interpolation
G18 - z-x plane for circular interpolation
G19 - y-z plane for circular interpolation
G20 - turning cycle or inch data
G21 - thread cutting cycle or metric data
G24 - face turning cycle
G25 - wait for input to go low
42
‘G’ Codes Cont’d
G26 - wait for input to go high
G28 - return to reference point
G29 - return from reference point
G31 - Stop on input
G33-35 - thread cutting functions
G35 - wait for input to go low
G36 - wait for input to go high
G40 - cutter compensation cancel
G41 - cutter compensation to the left
G42 - cutter compensation to the right
G43 - tool length compensation, positive
G44 - tool length compensation, negative
G50 - Preset position
G54 – Work offset positioning Coordinate Number one.
G70 - set inch based units or finishing cycle
G71 - set metric units or stock removal
43
G72 - indicate finishing cycle
‘G’ Codes Cont’d
G72 - 3D circular interpolation clockwise
G73 - turning cycle contour
G73 - 3D circular interpolation counter clockwise.
G74 - facing cycle contour
G74.1 - disable 360 deg arcs
G75 - pattern repeating
G75.1 - enable 360 degree arcs
G76 - deep hole drilling, cut cycle in z-axis
G77 - cut-in cycle in x-axis
G78 - multiple threading cycles
G80 - fixed cycle cancel
G81-89 - fixed cycles specified by machine tool manufacturers
G81 - drilling cycle
G82 - straight drilling cycle with dwell
G83 - drilling cycle
G83 - peck drilling cycle
G84 - taping cycle 44
‘G’ Codes Cont’d
G85 - reaming cycle
G85 - boring cycle
G86 - boring with spindle off and dwell cycle
G89 - boring cycle with dwell
G90 - absolute dimension program
G91 - incremental dimensions
G92 - Spindle speed limit
G93 - Coordinate system setting
G94 - Feed rate in ipm
G95 - Feed rate in ipr
G96 - Surface cutting speed
G97 - Rotational speed rpm
G98 - withdraw the tool to the starting point
G99 - withdraw the tool to a safe plane
G101 - Spline interpolation
45
Figure 19.1 The functions of a few common G-codes.
G00
RAPID TRAVERSE
G01
LINEAR INTERPOLATION
(STRAIGHT LINE MOVEMENT)
G02
CIRCULAR INTERPOLATION
(CLOCKWISE)
G03
CIRCULAR INTERPOLATION
(COUNTERCLOCKWISE)
46
Rapid Traverse Mode (G00)
• Rapid Traverse mode (G00) is the default and moves the
axes to a specified location at the rapid federate
programmed in the Program
• Cutter to move from the existing point to the target point
at the fastest speed.
• Parameters screen. Up to five axes (X, Y, Z, A, B) of
coordinated rapid motion can be specified while in this
mode.
Notes
• The G00 mode is canceled by using the G01, G02, G03,
or canned cycle (G73, G76, G81–G89) commands.
The format
• G00 X Y _Z _A B
Linear Interpolation Code (G01)
• The Linear Interpolation code (G01) moves the axes to a
specified location at the programmed federate.
• Up to five axes (X, Y, Z, A, B) of coordinated motion can be
specified while in this mode.
• The programmed feedrate can be changed by adding an F word
to any NC block while in this mode. X, Y, Z, A, B, and F
dimensions need to be supplied only if they change.
Notes
• G01 is a member of the tool positioning code group and is
canceled by G00, G02, G03 and the canned cycle (G73, G76,
G81–G89) commands.
• G90 specifies absolute dimensioning and G91 specifies
incremental dimensioning.
The format of the linear interpolation command is as follows:
• G01 X Y Z A B F
Circular and Helical Interpolation (G02 and G03)
• These two codes are members of the tool positioning code group.
The Clockwise Circular or Helical Interpolation code (G02)
causes the axes to generate an arc or helix in a clockwise
direction.
• The Counterclockwise Circular or Helical Interpolation code
(G03) causes the axes to generate an arc or helix in a
counterclockwise direction.
• The previous block’s end point defines the start point of the arc.
Notes
• Both G02 and G03 codes are canceled by G00, G01, the
canned cycle (G73, G76, G81–G89) commands, or by each
other.
• G17, G18, or G19 specify plane of interpolation.
49
• The formats of the Circular Interpolation commands are as
follows:
• Circular interpolation (Z = 0)
• Helical interpolation (Z ≠ 0 for G17) (Y ≠ 0 for G18) (X ≠ 0 for G19)
• G02/G03 (for G17) X _ Y _ {R_ or [I_ and J ]} Z F_
• G02/G03 (for G18) X _ Z _ {R or [I and K_ ]} Y _ F
• G02/G03 (for G19) Y_ Z {R _ or [J_ and K _ ]} X F_
50
G04 - Dwell
For a dwell, program G04 P~ . This will keep the axes
unmoving for the period of time in seconds or
milliseconds specified by the P number.
The G04 code is used to enter a set time delay into the
program (called a "dwell").
A G04 command is written in the following format:
G04 X _ _ _ _ ;
or G04 P _ _ _ _ ;
Where the dwell value is programmed using the address
letters
X (time in seconds) or
P (time in 1/1000 seconds), followed by a
number indicating this dwell value.
51
G04 – Dwell Cont’d
For example:
• G04 X3.5 - This command is read perform a dwell of 3.5
seconds duration.
• G04 P2500 - This command is read perform a dwell of 2.5
seconds duration.
• A decimal point cannot be used with the address P.
• The dwell is performed at the start of the block in which it is
programmed.
• The dwell begins when the commanded federate of the
previous block reaches zero.
• The maximum value of a dwell time is 999 seconds.
• G04 is a non-modal G code. It is only active in the block in
which it is programmed.
• A G04 code can be written into a program in two ways.G04
or G4.
52
Tool Offsets G40–G49
• Tool Offsets include Cutter Compensation and the Tool Length
and Tool Radius Offsets.
• Cutter Compensation G codes G40–G42 are used to control tool
movement.
• The Tool Length Offset Table contains the tool length offset
(G43, G44), and is accessed from the Tool Setup screen.
• Tool Radius Offset Table holds signed values for cutter
compensation (G40–G42) and diameter compensation (G43–
G48), and is accessed from the Tool Length Offsets screen.
• The measurement units for the offsets in the Tool Offset Table
depend on the programmed units.
• If -9.5 is entered for tool offset, that tool offset is -9.5 inches or
-9.5 mm, depending on the unit of measurement (G20 or G21).
53
Units of Measure G70, G71.
• Before setting the coordinate system at the beginning of
the program, the units of measure must be specified in
an independent block. A part program may switch
between English and Metric modes as long as the
format of the dimensions is correct for the chosen
mode.
• The Imperial Units of Measure code (BNC G70 signals
the system that the dimensions are in inches.
• The Metric Units of Measure code (BNC G71signals
the system that the dimensions are metric units.
• BNC G71 is canceled by G70.
Format -
• G70: Inch command
• G71: Metric command 54
Absolute and Incremental (G90, G91)
• The Absolute Machining Mode (G90) is the default
and signals the system that the programmed
dimensions are relative to part zero.
• Once programmed, this default stays in effect until
canceled with a G91.
• The Incremental Machining Mode (G91) signals the
system that all programmed dimensions are
incremental distances from the position in the previous
block.
• Once programmed, this mode stays in effect until
canceled with a G90.
• If Absolute Machining Mode (G90) is activated, the
center points I, J, and K are absolute Cartesian
(rectangular) coordinates from part zero.
• If Incremental Machining Mode (G91) is activated,
the center points I, J, and K are signed incremental
distances from the arc start point.
Format - This is the command format for each position
command:
• Absolute command :
G90 X Y Z
• Incremental command :
G91 X Y Z
20. Miscellaneous Functions (M Codes)
M03
DIRECTION OF ROTATION
(CLOCKWISE)
M04
DIRECTION OF ROTATION
(COUNTERCLOCKWISE)
M06
TOOL CHANGE WITH
AUTOMATIC RETRACTION
M30
END OF PROGRAM
AND
RETURN TO BEGINNING
OF PROGRAM
61
Program Functions Cont’d
The Program Functions (M00, M01, M02, and M30) stop the
execution of the part programs.
1 Program Stop (M00)
• The Program Stop (M00) cancels the spindle and coolant
functions and terminates further program execution after
completion of other commands in the same program block.
• Cycle complete; press start to continue. Pressing the Start Cycle
button resumes the spindle and coolant operation and continues
the program execution.
• This M code should not be set simultaneously with other M codes.
M00 is executed following execution of the rest of the address
words on the block.
• Here is an example using the M00 code: N10 G01 X2. Y1. F10.
M00
• In this example, the machine moves to the X2,Y1 location before
it shuts down. 62
2. Planned Stop (M01)
• The Planned Stop Code (M01) pauses the program
and shuts off the spindle.
• M01 is ignored unless previously validated in the
parameter page.
• If you want to open the CE Safety enclosure doors
after M01 executes, press the Machine Mode Interrupt
console key, then press the Start Cycle button.
• The enclosure doors can be opened and the axes
jogged.
• To continue with the program, close the enclosure
doors and press the Start Cycle button.
3. End of Program (M02)
• The End of Program code (M02) indicates the end of the
main program (the completion of the part).
• M02 stops the spindle, the coolant, and the axis feed after
completing all of the commands in the program.
• M02 is active after the block is executed.
4. Start Spindle Clockwise (M03)
• The Start Spindle Clockwise code starts a clockwise spindle
rotation (as viewed from the headstock). The spindle reaches
the programmed speed before X, Y, and Z (also A and B if
present) axis feed starts.
• If the spindle speed has not been defined, the Tool Setup
screen’s spindle speed is used.
• M03 is active before the other commands in the block are
executed.
5. Start Spindle Counterclockwise (M04)
• The Start Spindle Counterclockwise code starts spindle rotation
in a counterclockwise direction (as viewed from the headstock).
• The spindle reaches the programmed speed before X, Y, Z (A or
B) feed starts.
• If the spindle speed has not been defined, the Tool Setup screen’s
spindle speed is used.
• M04 is active before the other commands in the block are
executed.
6 Spindle OFF (M05)
• The Spindle Off code is the default and causes the spindle to stop
in a normal manner. If the machine is equipped with a brake, it is
applied.
• The coolant is also turned OFF.
• M05 is active after the other commands in the block are executed
7. End Program (M30)
• This command indicates the end of the main
program and is necessary for the registration of
CNC commands from tape to memory.
• When the end of program command is executed,
the CNC enters a reset state and the program
returns to the beginning.
21. Spindle Speed Code (S)
The Spindle Speed code (S) specifies the spindle
rotation speed.
The spindle does not rotate until a Start Spindle
Clockwise (M03) or a Start
69
23. I AND J
The above tool path can be programmed as The above tool path can be programmed as follows (In
follows (In absolute mode, G9Ø): incremental mode, G91):
• G03 X80 Y60 I-20 • G03 X-20 Y20 I-20
• G01 X60 • G01 X-20
• G02 X40 Y40 I-20 • G02 X-20 Y-20 I-20
• Or, • Or,
• G01 X100 Y40 F125 • G03 X-20 Y20 R20
• G03 X80 Y60 R20 • G01 X-20
• G01 X60 • G02 X-20 Y-20 R20
• G02 X40 Y40 R20
71
24. Modal and Non-Modal G Codes.
I, Modal (Retained) G codes.
• A modal G code, once programmed into a block, will affect
any subsequent blocks of the program without having to be
restated.
• Additionally, modal G codes are further split into groups
according to their task and function. A modal G code will
remain active until another G code from the same group is
programmed into a block, or it is cancelled.
For example,
72
Modal Commands Cont’d
• It is not necessary to enter a modal G code in repetitive
blocks within a program. If all movements are G01 (linear
cutting command) then G01 is entered on the first block
and omitted from all subsequent blocks. This G code will
remain active until an interpolation change is commanded
(using G00, G02 or G03).
G00 Positioning (Rapid Traverse)
G01 Linear Interpolation (Cutting Feed)
G02 Circular Interpolation CW
G03 Circular Interpolation CCW
• The codes G40, G41 and G42 are modal, belonging to the
same modal family. They are incompatible with each
other on the same block.
73
Modal Commands Cont’d
• Modal commands are arranged in sets called "modal
groups".
• Only one member of a modal group may be in force at
any given time.
• In general, a modal group contains commands for
which it is logically impossible for two members to be
in effect at the same time.
• Measurement in inches vs. measure in millimeters are
modal. A machine tool may be in many modes at the
same time, with one mode from each group being in
effect.
74
Table- The modal groups used in the interpreter
Group 1 - {G00, G01, G02, G03, G80, G81, G82, G83, G84, G85, G86,
G87, G88, G89} - Motion
Group 2 - {G17, G18, G19} - Plane Selection
Group 3 - {G90, G91} - Distance Mode
Group 5 - {G93, G94} - Spindle Speed Mode
Group 6 - {G20, G21} - Units
Group 7 - {G40, G41, G42} - Cutter Diameter Compensation
Group 8 - {G43, G49} - Tool Length Offset
Group 10 -{G98, G99} - Return Mode in Canned Cycles
Group 12 -{G54, G55, G56, G57, G58, G59, G59.1, G59.2, G59.3}
Coordinate System Selection
Group 2 - {M26, M27} - Axis Clamping
Group 4 - {M00, M01, M02, M30, M60} - Stopping
Group 6 - {M06} - Tool Change
Group 7 - {M03, M04, M05} - Spindle Turning
Group 8 - {M07, M08, M09} - Coolant
Group 9 - {M48, M49} - Feed and Speed Override Bypass
II, Non-Modal (one-shot) G codes.