Download as pdf or txt
Download as pdf or txt
You are on page 1of 76

ADAMA SCIENCE AND TECHNOLOGY UNIVERSITY

School of Mechanical, Chemical and Materials


Engineering
DEPARTMENT OF MECHANICAL ENGINEERING
Computer Aided Manufacturing
CAD/CAM (Meng 4306)
Instructor:- Kemal Temam (MSc)
Email;- kems624121@gmail.com
Part 1
February -2024
Adama, Ethiopia 1
Terminology

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

BNC – Brighton NC Machine, Machining Company


2
1. Introduction

What is Computer Numerical Control?


Definition
• CNC = Computer Numerical Control. A computer
“controller” reads G-code or machine language
instructions and drives a tool.
• The NC (Numerical control) program is a detailed
set of step by step instructions that tell the machine
which path to follow and which operations to
perform.

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

 Reduced scrap rate: Use of Part programs that are


developed using optimization procedures
 Reliable and Safe operation: Advanced engineering
practices for design and manufacturing, automated
monitoring, improved maintenance and low human
interaction
 Multi-operational machining: some NC machine
tools, for example machine centers, are capable of
accomplishing a very high number of machining
operations thus reducing significantly the number of
machine tools in the workshops.

5
Advantages of a CNC Machine Cont’d

• Smaller footprint: Due to the fact that several machines are fused
into one.

• High accuracy and repeatability


• Reduced production costs
• Reduced indirect operation costs
• Facilitation of complex machining operations
• Improved production planning and control
• Lower operator skill requirement

6
3. The main disadvantages of NC systems

 It requires a high initial investment and start-up cost.


 More complicated maintenance due to the complex
nature of the technologies

 Need for skilled part programmers


 High utilization required
 It is prone to computer errors and technology failures

7
4. How CNC Works

• Controlled by G and M codes.


• These are number values and co-ordinates.
• Each number or code is assigned to a particular operation.
• Typed in manually to CAD by machine operators.
• G&M codes are automatically generated by the computer
software.

8
5. Features of CNC Machine

 The tool or material moves.


 Tools can operate in 1-5 axes.
 Larger machines have a machine control unit (MCU)
which manages operations.

 Movement is controlled by a motors .


 Feedback is provided by sensors.
 Tool magazines are used to change tools automatically.

9
6. Tools

• Most are made from ;


 High speed steel (HSS)
 Tungsten carbide or ceramics.
• Tools are designed to direct waste away from the
material.
• Some tools need coolant such as oil to protect the
tool and work.

10
7. Basic Machine Axes: 3 axis

Milling Machines: 3 axis


X. Axis (table left and right)
• It should be horizontal.
• It is generally the longest axis of
movement of work piece or tool.
• It should be perpendicular to Z-axis.
• It is always parallel to surface of the holding
device.
Y. Axis (table in and out)
• It should be perpendicular to X and Z-axes.
Z. Axis (usually the spindle axis)
• It is always parallel to the spindle.
• It should be perpendicular to the X and Y-axis.
Additional Axes
A – axis (angular axis about X - axis)
B – axis (angular axis about Y – axis)
C – axis (angular axis about Z – axis)
U – axis (secondary axis parallel to X)
V – axis (secondary axis parallel to Y)
W – axis (secondary axis parallel to Z)
8. Tool Paths, Cutting and Plotting Motions
• Tool paths describes the route the cutting tool takes.
• Motion can be described as point to point, straight cutting or
contouring.
• Speeds are the rate at which the tool operates e.g. rpm.
• Feeds are the rate at which the cutting tool and work piece
move in relation to each other.
• Feeds and speeds are determined by cutting depth, material
and quality of finish needed. e.g. harder materials need
slower feeds and speeds.
• Rouging cuts remove larger amounts of material than
finishing cuts.
• Rapid traversing allows the tool or work piece to move
rapidly when no machining is taking place.
9. CNC programming Important things to know:

 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

• Programming consists of a series of instructions in form of


letter codes;-
• N codes;-specify program line number to executed by the
MCU
• Preparatory Codes;- G codes-Initial machining setup and
establishing operating conditions
• Axis Codes;- X,Y,Z -Used to specify motion of the slide
along X, Y, Z direction
• Feed and Speed Codes;- F and S-Specify feed and spindle
speed
• Tool codes;- T-specify tool number
• Miscellaneous codes;-M codes For coolant control and other
activities

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

 % – Main Programme (1 to 9999)


 O -Program number (Used for program identification)
 N -Sequence number (Used for line identification)
 G -Preparatory function
 X -X axis designation
 Y -Y axis designation
 Z -Z axis designation
 R -Radius designation
17
Programming Key Letters/Symbols Used Cont’d
 F –Feed rate designation
 S -Spindle speed designation
 H -Tool length offset designation
 D -Tool radius offset designation
 M -Miscellaneous function
 L– Sub program (1 to 999)/Home position
 Lf – Block end (EOB) means “; or *”
 T – Tool number or Tool station number
 I, J, K – Circle parameters
 B/U/R – Radius
 P – Passes.
13. Motion Control Systems
1. Point-to-Point Systems
– Also called position systems
– System moves to a location and
performs an operation at that
location (e.g., drilling)
– Also applicable in robotics
2. Continuous Path Systems
– Also called contouring systems
in machining
– System performs an operation
during movement (e.g., milling
and turning)
14. Interpolation Methods
1. Linear interpolation
– Straight line between two points in space
– like turning a straight diameter, face or taper, milling straight
surfaces, and when drilling.
– “G01” is the common term used to specify straight line
motion and programmers will include the desired end point
in each axis within this command.
2. Circular interpolation
– Circular arc defined by starting point, end point, center or
radius, and direction.
– Two G-codes, the “G02” (Clockwise ) and the “G03” anti-
Clockwise) are commonly used while programming circular
motions into a machine.
Interpolation Methods Cont’d
3. Helical interpolation
– Circular plus linear motions
– simultaneous motion in multiple axes–X, Y,
and Z.
• When Should Helical Interpolation be Used?
• Helical motions are typically used for three
cases:
1. Making holes
2. To create Circular Ramping to get a cutter down
to proper depth. before machine like pocket.
3. To perform thread milling.
4. Parabolic and cubic interpolation
– Free form curves using higher order
21
equations
15. NC WORDS
1. Circular Interpolation
Full circle ON
destination
(5.000,4.000) ?
sequence no. center

N0100 G02 X7.000 Y2.000 I5.000 J2.000

Cut from (5.000,4.000) to (7.000,2.000) CW

(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

Minimum rotation: ¾  pitch K=26,66


Pitch K ≥ 26,66:
The helix from a to b will generally be executed in ¾ rotation, because
the correction is limited to the maximum possible pitch K = 26,66.
Pitch K < 26,666:
NC WORDS Cont’d
2. Helical Interpolation
NC WORDS - F and S Codes Cont’d
F Code. feed speed.
 ipm (inchs per min) or ipr (inches per revolution)
 F code must be given before either G01, G02, or
G03 can be used.
 Example:
 N0100 G02 X7.000 Y2.000 I5.000 J2.000 F6.00
S Code. cutting speed code
 Programmed in rpm.
 S code does not turn on the spindle, spindle is
turned on by a M code.
 N0010 S1000
NC WORDS- T and R Codes Cont’d

• T Code. tool number.


 Actual tool change does not occur until a tool
change M code is specified.
• R Code. cycle parameter.
It can be used in canned (drilling) cycles to define
the “Rapid Plane” (how far above the part to rapid
the tool to),
N0010 G81 X1.000 Y2.000 Z0.000 R 1.300
• Q - Canned Cycle Optional Data
The letter Q is used in canned cycles, most often as
the “Peck” distance in a drilling cycle.
16. Cutter Offset
• Cutter path must be offset from actual part outline by
a distance equal to the cutter radius.
Tool Length Compensation - G43
• The operator will determine the tool length and input that
dimension into the Tool offset Memory for that tool.
• Each tool in the machine will
have a defined tool length,
presented in the form of an
“H” value.
• H1- is equal to tool length
offset #1
• H2- tool length offset #2, etc.
• Canceling Tool Compensation
(G49 or H00, G28, M30)
Cutter Path Generation
• Cutter path is generated by moving the tool from point to
point.
• The points are previously defined from the part drawing
dimensions.
• Each line of code will show the destination point of
where the tool will go to.
Cutter Path Generation
Tool Radius Compensation
Tool radius compensation is a
function for automatically
calculating and offsetting error (an
error caused by the tool rounding
arises during taper cutting or arc
interpolation between the actually
programmed shape and the cutting
shape) by setting the nose radius or
tool radius value.

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

• A program which contains fixed sequences or frequently


repeated patterns may be entered into memory as a Sub
Program in order to simplify the main program.
• A sub program is entered into the machine controller memory in
Edit Mode, in the same manner as the main program.
Differences between a sub and main program:
• A sub program does not have a billet size definition at the top
of the program listing.
• A sub program is ended by the M99 code.
• When the main program calls one sub program into operation,
the process is called a one-loop sub program call.
• It is possible to program a maximum four- loop sub program
call within the main 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_

Figure 18.3 Circular


and Helical Interpolation

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)

 Miscellaneous Functions (M codes) cause


machine-related action.
 e.g., Coolant control and Tool changes.
 Each Miscellaneous Function is explained
below. Multiple M codes can be used within
an NC block.
M Code- Operation Codes Cont’d
• M00 Cancels the spindle and coolant functions; stops
part program
• M01 Program stop often used when the operator wants
to refixture the part.
• M02 Marks the end of the program; stops the spindle,
coolant, and axes feed.
• M03 Starts clockwise rotation of the spindle
• M04 Starts counterclockwise rotation of the spindle
• M05 Switches the spindle off
• M06 Requests an automatic tool change
• M07 Switches on secondary coolant systems
• M08 Switches on primary coolant system
• M09 Switches off both the primary and secondary
coolant 58
‘M’ Codes Cont’d
• M10 Switches on both the primary and secondary
coolant
• M20 Advances the indexer one position
• M25 Retracts the Z axis to the home position (tool
change height)
• M29 Enables rigid tapping
• M30 Indicates the end of the main program
• M32 Clamps the rotary A axis
• M33 Unclamps the rotary A axis
• M34 Clamps the rotary B axis
• M35 Unclamps the rotary B axis
• M36 Switches off the servos
• M38 Reads and places the state of the laser OK signal.
• M39 Reads and places the state of the laser static signal.
59
“M”Codes Cont’d
• M46 Closes the shutter.
• M47 Turns the laser emitter on.
• M48 Turns the laser emitter off.
• M49 Turns the laser receiver on.
• M50 Turns the laser receiver off.
• M76 Normal AAxis operation (default)
• M77 Reverses A Axis operation
• M78 Normal B Axis operation (default)
• M79 Reverses B Axis operation
• M80 C Axis is right-handed (default)
• M81 C Axis is left-handed
• M98 Subprogram call
• M99 Jump; Return from subprogram
60
Figure 20.1 The functions of a few common 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

 Spindle Counterclockwise (M04) is programmed.


 The software retrieves the spindle speed from the tool
library if an S code is not provided.
22. Tool Functions
• These codes control tool selection: D, L, and T. the D and L
codes are for BNC only. (BNC- CNC Flat Bed Lathe Machine).
• To activate these codes, an M06 code must be contained in the
same block.
• The NC Parameters screen contains two fields for controlling
tool changes:
• The Default Tool Number and the M06 Initiates Tool Change.
1. D Codes (BNC)
• The Tool Diameter Offset codes (D values) are used in BNC
programs and cause the specified dimension to be loaded into
the tool diameter register.
• Otherwise, the Diameter value in the appropriate Tool Setup
data is used.
• This dimension is used for cutter compensation.
• Negative values are not permitted. 68
2. L Codes (BNC)
• The Tool Length Offset (L) codes cause the specified
dimension to be loaded into the tool offset register.
Otherwise, the Zero Calibration value in the appropriate
Tool Setup data is used.
• Negative values are not permitted.
3. T Codes
• The Tool Select (T) codes specify the tool number.
• The value is composed of up to two digits.
• Placing the T word in a block does NOT cause a tool
change to occur.
• If the M6 Initiates Tool Change field is set to yes, the M06
code must be used to initiate the tool change.

69
23. I AND J

• To program an arc when only the arc centre is


given (the radius is unknown) use the address
letters I and J.
• I relate to the address X and is the incremental
value and direction (+/-) from the start point of the
arc in the X axis to the arc centre (see diagram
below).
• J relates to the address Y and is the incremental
value and direction (+/-) from the start point of the
arc in the Y axis to the arc centre (see diagram
below).
70
For example

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.

• A non-modal G code must be programmed into every


block when it is required, i e, it is only effective in the
block in which it is specified.
 G04 -Dwell, Exact Stop
 G28 - Reference Point Return
 G170- Circular Pocket Canned Cycle
 G171 - Circular Pocket Canned Cycle
 G172 - Rectangular Pocket Canned Cycle
 G173 - Rectangular Pocket Canned Cycle
 Other Non Modal G codes are:- G09, G10, G11,
G27,G29,G30,G31,G45,G46,G47,G48,G50,G51,G52,
G53,G60,G65,G70,G71,G72,G73,G74,G75,G76.

You might also like