25 CNC programming.pdf

(59 KB) Pobierz
167047121 UNPDF
Information Needed by a CNC
Machine
Machine
CNC Programming
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
Lecture 25
Engineering 475
Automated Production Systems
Automated Production Systems
This information is conveyed to the machine through a set
of instructions arranged in a desired sequence – Program .
Cartesian Coordinate Systems
Right Hand Rule
Z
Y
X
Consists of three axes positioned 90
degrees from each other.
Chang, Fig. 10.1
The right hand rule is used to define the
positive direction of the coordinate axes.
Nanfara, Fig. 2.1
Standard Lathe
Coordinate System
Gantry Mill Coordinate
System
Coordinate System
System
Nanfara, Fig. 2-4
Nanfara, Fig. 2-3
1
Information Needed by a CNC
Lecture 25
Engineering 475
Standard Lathe
Gantry Mill Coordinate
167047121.010.png 167047121.011.png 167047121.012.png
Vertical Mill or Drill
Coordinate System
Milling Tool Coordinate System
Coordinate System
Chang, Fig. 10.3
Nanfaro, Fig. 2-6(b)
Cartesian Coordinate
System Planes
Absolute Coordinates
X-Y Plane
X-Z Plane
x
Y-Z Plane
Nanfaro, Fig. 2-7
Nanfaro, Fig. 2-10
Incremental Coordinates
Coordinate System Exercise
Nanfaro, Fig. 2-11
2
Vertical Mill or Drill
Cartesian Coordinate
System Planes
167047121.013.png 167047121.001.png 167047121.002.png 167047121.003.png 167047121.004.png 167047121.005.png 167047121.006.png
Letter Codes
Letter Codes
(G and M Codes)
(G and M Codes)
Example CNC Program
• Each instruction to the machine
consists of a letter followed by
a number.
Example CNC Program
G-codes : Preparatory Functions
– involve actual tool moves.
N5 G90 G20
N10 M06 T3
N15 M03 S1250
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.125 F5
N35 X3 Y2 F10
N40 G00 Z1
N45 X0 Y0
N50 M05
N55 M30
N5 G90 G20
N10 M06 T3
N15 M03 S1250
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.125 F5
N35 X3 Y2 F10
N40 G00 Z1
N45 X0 Y0
N50 M05
N55 M30
• Each letter is associated with a
specific type of action or piece
of information needed by the
machine.
M-codes : Miscellaneous
Functions – involve actions
necessary for machining (i.e.
spindle on/off, coolant on/off).
Letters used in Codes
N,G,X,Y,Z,A,B,C,I,J,K,F,S,T,R,M
Letter Codes
(G Codes)
(G Codes)
Letter Codes
(M Codes)
(M Codes)
G00
Rapid traverse
G40 Cutter compensation – cancel
G41 Cutter compensation – left
G42 Cutter compensation- right
G70 Inch format
G71 Metric format
G74 Full-circle programming off
G75 Full-circle programming on
G80 Fixed-cycle cancel
G81-G89 Fixed cycles
G90
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
G01
Linear interpolation
G02
Circular interpolation, CW
G03
Circular interpolation, CCW
G04
Dwell
G08
Acceleration
G09
Deceleration
G17
X-Y Plane
G18
Z-X Plane
G19
Y-Z Plane
Absolute dimensions
G20
Inch Units (G70)
G91
Incremental dimensions
G21
Metric Units (G71)
Letter Codes
(N Codes)
Letter Codes
(X,Y, and Z Codes)
(N Codes)
(X,Y, and Z Codes)
Example CNC Program
Example CNC Program
N-codes : Gives an
identifying number for each
block of information.
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.
• The number may require that a
specific format be used (i.e. 3.4
means three numbers before
the decimal and four numbers
after the decimal).
N5 G90 G20
N10 M06 T3
N15 M03 S1250
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.125 F5
N35 X3 Y2 F10
N40 G00 Z1
N45 X0 Y0
N50 M05
N55 M30
N5 G90 G20
N10 M06 T3
N15 M03 S1250
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.125 F5
N35 X3 Y2 F10
N40 G00 Z1
N45 X0 Y0
N50 M05
N55 M30
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.
3
Letter Codes
Letter Codes
Letter Codes
Letter Codes
Letter Codes
167047121.007.png
Letter Codes
(I,J, and K Codes)
Letter Codes
(F, S, and T Codes)
(I,J, and K Codes)
(F, S, and T Codes)
Example CNC Program
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.
• The number may require that a
specific format be used (i.e. 3.4
means three numbers before
the decimal and four numbers
after the decimal).
Example CNC Program
F-code : used to specify the feed
rate
N5 G90 G20
N10 M06 T3
N15 M03 S1250
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.125 F5
N35 X3 Y2 F10
N40 G00 Z1
N45 X0 Y0
N50 M05
N55 M30
N5 G90 G20
N10 M06 T3
N15 M03 S1250
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.125 F5
N35 X3 Y2 F10
N40 G00 Z1
N45 X0 Y0
N50 M05
N55 M30
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.
Letter Codes
(R and P Codes)
Program Start Flag and Program
Identification Number
Identification Number
(R and P Codes)
Example CNC Program
N5 G90 G20
N10 M06 T3
N15 M03 S1250
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.125 F5
N35 X3 Y2 F10
N40 G00 Z1
N45 X0 Y0
N50 M05
N55 M30
R-code :
•Retract distance when used with
G81, 82, and 83.
•Radius when used with G02 and
G03.
Example CNC Program
%
:1045
N5 G90 G20
N10 M06 T3
N15 M03 S1250
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.125 F5
%
Program start flag. Placed at
the beginning of each program.
:1025 Program identification number.
Follows the program start flag
at the beginning of each
program.
P-code : Used to specify the
dwell time associated with
G04.
Only two commands that
don’t start with a letter.
Three Major Phases of a CNC
Program
Three Major Phases of a CNC
Program
Program
Program
Phase 1 - Program Setup
Program Setup
Phase 2 – Material Removal
Material Removal
%
(Program start flag)
N20 G00 X1 Y1 (Rapid to X1,Y1 from origin point)
N25 Z0.125 (Rapid down to Z0.125)
N30 G01 Z-0.125 F5 (Feed down to Z-0.125 at 5 ipm)
N35 G01 X2 Y2
:1001
(Four digit program number)
N5 G90 G20
(Absolute units, inches)
(Feed diagonally to X2,Y2)
N10 M06 T2
(Stop for tool change, use tool # 2)
N40 G00 Z1
(Rapid up to Z1)
N15 M03 S1200
(Turn the spindle on CW to 1200 rpm)
N45 X0 Y0
(Rapid to X0,Y0)
Nanfara, pg. 36
Nanfara, pg. 36
4
Letter Codes
Letter Codes
Program Start Flag and Program
Letter Codes
Three Major Phases of a CNC
Three Major Phases of a CNC
Phase 1
Phase 2
167047121.008.png
Three Major Phases of a CNC
Program
Block Format
Program
Sample Block
N135 G01 X1.0 Y1.0 Z0.125 F5
Phase 3 – System Shutdown
System Shutdown
• 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 feedrate
• 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
N50 M05
(Turn the spindle off)
N55 M30
(End of program)
Nanfara, pg. 36
Nanfara, pg. 36
Modal G- Codes
Codes
Modal G- Code List
Code List
Example CNC Program
G00 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
G43
Tool length compensation (plus)
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”.
N5 G90 G20
N10 M06 T3
N15 M03 S1250
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.125 F5
N35 X3 Y2 F10
N40 G00 Z1
N45 X0 Y0
N50 M05
N55 M30
G44
Tool length compensation (minus)
G49
Tool length compensation cancel
G80
Cancel canned cycles
G81
Drilling cycle
G82
Counter boring cycle
Cutter compensation cancel
G83
Deep hole drilling cycle
G41
Cutter compensation left
In the example, G00 and
G01 are modal.
G42
Cutter compensation right
G90
Absolute positioning
G43
Tool length compensation (plus)
G91
Incremental positioning
Assignment
Review the material presented.
Next class we look at an example,
and will develop G-code programs
in class.
5
Three Major Phases of a CNC
Phase 3
Modal G
Modal G
167047121.009.png
Zgłoś jeśli naruszono regulamin