2. • Controlled by G and M codes.
• These are number values and co-ordinates.
• Each number or code is assigned to a particular operation.
• Manually Programmed by machine operators.
• G & M codes are automatically generated by the computer software.
HOW CNC WORKS
3. • The tool or material moves automatically.
• Larger machines have a machine control unit (MCU) which manages
operations.
• Movement is controlled by motors.
• Feedback is provided by sensors.
• Tool magazines are used to change tools automatically.
FEATURES OF CNC MACHINERY
4. � A Part Program is a list of coded instructions which describes how the design
component, or part, will be manufactured.
� The part program can be further broken down into separate lines of data, each line
describing a particular set of machining operations. These lines, which run in
sequence, are called blocks.
� A block of data contains words, sometimes called codes. Each word refers to a
specific cutting/movement command or machine function, which includes the G
and M code groups. Each program word is composed from a letter called the
address, along with a number.
N2 G91 G0 X0 Y0 Z0
N3 M6 T1
N4 G43 H1
N5 M3 S3000
Composition of a Part Program
5. Composition of a Part Program
N08 G01 Z-0.5 F40 BLOCK EXAMPLE – N08 G01 Z-0.5 F40
WORD EXAMPLE –
G01
ADDRESS EXAMPLE -
G
6. Addresses
Address Refers to
N refers to the block number.
G refers to the G code (Preparatory function).
X refers to the absolute/incremental distance travelled by the slide tool
in the X axis direction.
Y refers to the absolute/incremental distance travelled by the slide tool
in the Y axis direction.
Z refers to the absolute/incremental distance travelled by the slide tool
in the Z axis direction.
F refers to the feed rate.
M refers to the M code (Miscellaneous function).
S refers to the spindle speed.
T refers to the tooling management.
Each
7. Coordinates System
� Absolute Coordinates:(G90)
The addresses X, Y and Z within a program, when G90 (Absolute
co-ordinates) is active, relate to a coordinate position from the
work piece datum (the zero position).
9. � Incremental Coordinates:(G91)
The addresses X, Y and Z within a program, when G91
(Incremental co-ordinates) is active, relate to the individual axis
movements required to reach the new position, from the last
position reached by the tool.
Coordinates System
10. � Rapid Positioning (G0)
The G0 code executes a non cutting movement, at a rapid feed rate, to
a specific co-ordinate position. A G0 command is written in the
following format:
G0 X _ _ _ _ Y_ _ _ _ Z _ _ _ _ ;
� Liner Interpolation (G01)
The G01 code executes a cutting movement following a straight line,
at a set feed rate.
G01 X _ _ _ _ Y_ _ _ _ Z _ _ _ _F_ _ _ _ ;
� Circular Interpolation (G02,G03)
� The G02 code executes a cutting movement following a clockwise
circular path, at a set feed rate.
� The G03 code executes a cutting movement following a
counterclockwise circular path, at a set feed rate
G Codes
Preparatory Functions
11. G0 Rapid Transverse
G01 Linear Interpolation
G02 Circular Interpolation, CW
G03 Circular Interpolation, CCW
G17 XY Plane,G18 XZ Plane,G19 YZ Plane
G20/G70 Inch units
G21/G71 Metric Units
G40 Cutter compensation cancel
G41 Cutter compensation left
G42 Cutter compensation right
G81 Drilling cycle
G82 Counter boring cycle
G83 Deep hole drilling cycle
G90 Absolute positioning
G91 Incremental positioning
Table of Important G codes
12. M00 Program stop
M01 Optional program stop
M02 Program end
M03 Spindle on clockwise
M04 Spindle on counterclockwise
M05 Spindle stop
M06 Tool change
M08 Coolant on
M09 Coolant off
M30 Program stop, reset to start
Table of Important M codes