0% found this document useful (0 votes)
68 views21 pages

Lec 9

Uploaded by

Aymen Omer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views21 pages

Lec 9

Uploaded by

Aymen Omer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 21

CNC technology

LECTURE 9
CNC Programming

1
Contents:

CNC Programming

Basics of NC Part Programming:

BLOCK FORMAT

G&M Codes

2
CNC Programming

• There are three methods for CNC programing


1. Manual
• Write code directly
2. Computer-assisted
• Draw cutter path
3. CAD/CAM
• Draw the part
• Cutter path is generated
Types ofCNC PROGRAMMING

• Offline programming linked to CAD programs.


• Conversational programming by the operator.
• MDI ~ Manual Data Input.
• Manual Control using jog buttons or `electronic
handwheel'.
• Word-Address Coding using standard G-codes and
M-codes.

4
Basics of NC Part Programming:

During secondary motion, either the tool moves


relative to the workpiece or the workpiece
moves relative to the tool. In NC programming,
it is always assumed that the tool moves relative
to the workpiece no matter what the real
situation is.

5
The position of the tool is described
by using a Cartesian coordinate
system.
If (0,0,0) position can be described
by the operator, then it is called
floating zero.

6
In defining the motion of the tool from one
point to another, either:
1. absolute positioning mode or
2. incremental positioning mode can be used.

7
1. Absolute positioning. In this mode, the
desired target position of the tool for a particular
move is given relative to the origin point of the
program.

2. Incremental positioning. In this mode, the next


target position for the tool is given relative to the
current tool position.

8
INFORMATION NEEDED by
a CNC
1. Preparatory Information: units, incremental or absolute
positioning
2. Coordinates: X,Y,Z, RX,RY,RZ
3. Machining Parameters: Feed rate and spindle speed
4. Coolant Control: On/Off, Flood, Mist
5. Tool Control: Tool and tool parameters
6. Cycle Functions: Type of action required
7. Miscellaneous Control: Spindle on/off, direction of rotation,
stops for part movement
This information is conveyed to the machine through a set
of instructions arranged in a desired sequence – Program.

9
BLOCK FORMAT

Sample Block:

N135 G01 X1.0 Y1.0 Z0.125 F5


• Restrictions on CNC blocks
• Each may contain only one tool move
• Each may contain any number of non-tool move G-codes
• Each may contain only one federate
• Each may contain only one specified tool or spindle speed
• The block numbers should be sequential
• Both the program start flag and the program number must be
independent of all other commands (on separate lines)
• The data within a block should follow the sequence shown in the above
sample block

10
WORD-ADDRESS CODING

Example CNC Program


• N5 G90 G20 Each instruction to the machine
• N10 M06 T3 consists of a letter followed by a
• N15 M03 S1250 number.
• N20 G00 X1 Y1
• N25 Z0.1

Each letter is associated with a
N30 G01 Z-0.125 F5
• N35 X3 Y2 F10 specific type of action or piece of
• N40 G00 Z1 information needed by the machine.
• N45 X0 Y0 Letters used in Codes
• N50 M05
• N55 M30 N,G,X,Y,Z,A,B,C,I,J,K,F,S,T,R,M

11
G & M Codes

Example CNC Program


• N5 G90 G20 • G-codes: Preparatory Functions
• N10 M06 T3 involve actual tool moves.
• N15 M03 S1250
• N20 G00 X1 Y1 • M-codes: Miscellaneous
• N25 Z0.1

Functions – involve actions
N30 G01 Z-0.125 F5
• N35 X3 Y2 F10 necessary for machining (i.e.
• N40 G00 Z1 spindle on/off, coolant on/off).
• N45 X0 Y0
• N50 M05
• N55 M30

12
G Codes

• G00 Rapid traverse • G40 Cutter compensation –


• G01 Linear interpolation cancel
• G02 Circular interpolation,
• G41 Cutter compensation – left
CW • G42 Cutter compensation-
• G03 Circular interpolation, CCW right
• G04 Dwell • G70 Inch format
• G08 Acceleration • G71 Metric format
• G09 Deceleration • G74 Full-circle programming off
• G17 X-Y Plane • G75 Full-circle programming on
• G18 Z-X Plane • G80 Fixed-cycle cancel
• G19 Y-Z Plane • G81-G89 Fixed cycles
• G20 Inch Units (G70) • G90 Absolute dimensions
• G21 Metric Units (G71) • G91 Incremental dimensions

13
Modal G-Codes
• Most G-codes set the machine in a “mode” which stays in
effect until it is changed or cancelled by another G-code.
These commands are called “modal”.

14
Modal G-Code List

• G00 Rapid Transverse • G43 Tool length compensation


• G01 Linear Interpolation (plus)
• G02 Circular Interpolation, CW
• G44 Tool length compensation
• G03 Circular Interpolation, CCW
(minus)
• G17 XY Plane
• G18 XZ Plane
• G49 Tool length compensation
• G19 YZ Plane
cancel
• G20/G70 Inch units • G80 Cancel canned cycles
• G21/G71 Metric Units • G81 Drilling cycle
• G40 Cutter compensation cancel
• G82 Counter boring cycle
• G41 Cutter compensation left
• G42 Cutter compensation right • G83 Deep hole drilling cycle
• G43 Tool length compensation • G90 Absolute positioning
(plus)
• G91 Incremental positioning

15
M Codes

• 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
• M10 Clamps on
• M11 Clamps off
• M30 Program stop, reset to start

16
N Codes

• Gives an identifying number for each block of information.

• It is generally good practice to increment each block number by 5 or


10 to allow additional blocks to be inserted if future changes are
required.

17
X,Y, and Z Codes

• X, Y, and Z codes are used to specify the coordinate axis.


• Number following the code defines the coordinate at the end of the
move relative to an incremental or absolute reference point.

18
I,J, and K Codes

• I, J, and K codes are used to specify the coordinate axis when


defining the center of a circle.

• Number following the code defines the respective coordinate for the
center of the circle.

19
F,S, and T Codes

• F-code: used to specify the feed rate

• S-code: used to specify the spindle speed

• T-code: used to specify the tool identification number associated


with the tool to be used in subsequent operations.

20
Thank you

21

You might also like