Escolar Documentos
Profissional Documentos
Cultura Documentos
Post Process
Generate toolpaths
Verify
Writes G-code file
Solid Model
CAM
(Toolpath |
Verify | Post
Process)
(G-Code File)
CNC Machine
2011 Autodesk
%
O01111 (FACE
(T2 D=0.375 )
N10 G90 G94 G17
N15 G20
N20 G28 G91 Z0.
Lesson Overview
2011 Autodesk
objectives
List sequence of operations in a typical CNC program.
List most commonly used G/M-codes and their meaning.
List most commonly used special characters and their purpose.
Describe the organization, motion, and actions of a simple CNC
program.
2011 Autodesk
2011 Autodesk
%
O62806 (FACE-CONTOUR)
N10 G90 G94
N15 G20
N20 G28 G91 Z0.
N25 G90
N30 M09
N35 T1 M06
N40 T3
N45 S8149 M03
N50 G54
N55 M08
N60 G00 X4.495 Y-3.9294
N65 G43 Z0.8 H01
N70 Z0.2
N75 G01 Z0.0425 F20.
N80 G18 G03 X4.4575 Z0.005 I0.0375
N85 G01 X-0.2575 F32.59
N90 X-0.436
N95 G17 G02 Y-3.7486 J0.0904
N100 G01 X4.636
N105 X4.6375
N110 G03 Y-3.5677 J0.0904
N115 G01 X-0.4375
N120 G02 Y-3.3869 J0.0904
N125 G01 X4.6375
N130 G03 Y-3.2061 J0.0904
N135 G01 X-0.4375
N140 G02 Y-3.0253 J0.0904
N145 G01 X4.6375
Cnc language
Very efficient and compact language.
Standardizedsort of.
2011 Autodesk
CNC Language
G-code is a simple ASCII text file.
Can be read/edited in any text editor.
You DO NOT need to learn every code or how to write program by
hand.
2011 Autodesk
2011 Autodesk
2011 Autodesk
1)
2)
3)
4)
5)
6)
7)
8)
9)
10)
Program Start.
Load Tool.
Spindle ON.
Coolant ON.
Rapid above part.
Machining operation.
Coolant OFF.
Spindle OFF.
Move to Safe Position.
End Program.
2011 Autodesk
Description
Start of program.
Program number (Program Name).
Tool description for operator.
Safety block to ensure machine is in safe mode.
Load Tool #1.
Spindle Speed 9200 RPM, On CW.
Use Fixture Offset #1.
Coolant On.
Rapid above part.
Rapid to safe plane, use Tool Length Offset #1.
Rapid to feed plane.
Line move to cutting depth at 18 IPM.
CDC Left, Lead in line, Dia. Offset #1, 36 IPM.
Line move.
Line move.
Line move.
Line move.
Turn CDC off with lead-out move.
Rapid to safe plane.
Purpose
Start
Program
Change
Tool
Move
To
Position
Machine
Contour
2011 Autodesk
Description
Spindle Off.
Coolant Off.
Tool description for operator.
Load Tool #2.
Spindle Speed 3820 RPM, On CW.
Coolant On.
Rapid above hole.
Rapid to safe plane, use Tool Length Offset 2.
Rapid to feed plane.
Drill hole (canned) cycle, Depth Z-.325, F12.
Cancel drill cycle.
Rapid to safe plane.
Spindle Off.
Coolant Off.
Return to machine Home position in Z.
Return to machine Home position in XY.
Reset to absolute positioning mode (for safety).
Reset program to beginning.
End Program.
Purpose
Change
Tool
Move
To
Position
Drill
Hole
End
Program
2011 Autodesk
2011 Autodesk
ABCDEFGHIJKLMNOPQRSTUVWXYZ
% () / ;
2011 Autodesk
2011 Autodesk
Meaning
Rotation about X-axis.
Rotation about Y-axis.
Rotation about Z-axis.
Cutter diameter compensation (CDC) offset address.
Feed rate.
G-Code (preparatory code).
Tool length offset (TLO).
Arc center X-vector, also used in drill cycles.
Arc center Y-vector, also used in drill cycles.
Arc center Z-vector, also used in drill cycles.
M-Code (miscellaneous code).
Block Number.
Program Number.
2011 Autodesk
Meaning
Dwell time.
Used in drill cycles.
Arc radius, also used in drill cycles.
Spindle speed in RPM.
Tool number.
X-coordinate.
Y-coordinate.
Z-coordinate.
2011 Autodesk
Special characters
%
Marks start and end of program.
()
Operator comments.
/
Block Delete. This line ignored when the Block Delete
switch* is ON.
;
End of Block (line).
2011 Autodesk
modality
Modal: Remains in effect until cancelled or superseded by
another code.
Non-Modal: Active only in current block.
2011 Autodesk
2011 Autodesk
G&M codes
G-code syntax
Overview of common g-codes
M-codes
Purpose of M-codes.
M-codes you should know.
2011 Autodesk
G-Codes
Begin with letter G.
Called Preparatory codes because they prepare machine for
certain type of motion.
Followed by 1 or 2 digit number.
Older machines required leading zeros:
Example: G01
Example: G1
2011 Autodesk
Meaning
Rapid motion. Positions machine for non-milling
moves.
Line motion at a specified feed rate.
Clockwise arc.
Counterclockwise arc.
Dwell.
Return to machine home position.
Cutter Diameter Compensation (CDC) off.
Cutter Diameter Compensation (CDC) left.
Cutter Diameter Compensation (CDC) right.
Tool length offset (TLO).
Fixture Offset #1.
Fixture Offset #2.
Fixture Offset #3.
Meaning
G57
G58
G59
G80
G81
G82
G83
G84
Tap cycle.
G90
G91
G98
G99
2011 Autodesk
M-Codes
Begin with the letter M.
Called Miscellaneous codes because they control machine
auxiliary options:
Coolant.
Spindle direction.
2011 Autodesk
Meaning
M0
M1
M2
M3
M4
M5
M6
M8
M9
M30
End of program.
Spindle on Clockwise.
Spindle on Counterclockwise.
Spindle stop.
Change tool.
Coolant on.
Coolant off.
End program and press Cycle Start to run it again.
2011 Autodesk
G0 G1 G2 G3
G17 G18 G19
G43 G40 G41 G42
G54-G59
2011 Autodesk
Motion
Planes
Tool Offsets
Fixture Offsets
2011 Autodesk
2011 Autodesk
G-codes (g2/g3)
G2 = Clockwise arc.
G3 = Counterclockwise arc.
Arcs must line in a major plane (XY, XZ, YZ).
I,J are incremental distance are incremental distance arc start to
center.
2011 Autodesk
G-Codes (G17/g18/g19)
Mostly for 3D machining
G17 = XY Plane
G18 = XZ Plane
G19 = YZ Plane
2011 Autodesk
G-codes (G40/G41/G42)
2011 Autodesk
G-codes (G43)
2011 Autodesk
2011 Autodesk
2011 Autodesk
2011 Autodesk
G-codes (G81)
2011 Autodesk
G-codes (g82)
Spot drill cycle.
Same as drill cycle but with dwell to produce a clean face, set by
P-value.
Example: G98 G82 X.5 Y.5 Z-.0925 P.1 R.1 F9.5
P.1 = .1 second dwell after reaching Z-.0925 then rapid retract.
2011 Autodesk
G-codes (G84)
Tapping cycle.
Feed rate is determined by spindle speed and thread lead.
Many machines have rigid tapping.
2011 Autodesk
G-codes (g90)
Absolute positioning mode.
All CAM-generated programs positions should be in Absolute
mode.
2011 Autodesk
G-codes (G91)
Incremental positioning.
Only has one purpose with CAM-generated programs: fully
retract spindle in XY or Z.
Example:
2011 Autodesk
G-CODES (G98)
Used in drill cycle to control
clamp clearing.
Commands tool to jump to
previous Z (Initial Rapid
Height) between holes.
2011 Autodesk
G-codes (g99)
Used in drill cycle to control
clamp clearing.
Commands tool to jump to Z
set by R-value (Rapid Height)
between holes.
2011 Autodesk
summary
2011 Autodesk
summary
2011 Autodesk
summary
G2 is Clockwise arc.
G3 is Counterclockwise arc.
CAM software should output absolutely edit-free code.
You should know the most commonly used codes so you can
work efficiently.
2011 Autodesk