+ All Categories

g-code

Date post: 30-Nov-2015
Category:
Upload: nacer-mezghiche
View: 17 times
Download: 0 times
Share this document with a friend
Popular Tags:
56
It d ti t G Cd Introduction to G-Code Programming Programming Comp ter Integrated Man fact ring Computer Integrated Manufacturing Unit 2: CNC Machining Unit 2: CNC Machining
Transcript
Page 1: g-code

I t d ti t G C dIntroduction to G-Code ProgrammingProgramming

Comp ter Integrated Man fact ringComputer Integrated Manufacturing

Unit 2: CNC MachiningUnit 2: CNC Machining

Page 2: g-code

In this lessonIn this lesson:Review Coordinate Geometry Basics

Identify common TerminologyIdentify common Terminology

Examine G and M - Code languageExamine G and M Code language

Provide opportunities for Review and Practice

Page 3: g-code

Rectangular Coordinate SystemRectangular Coordinate SystemY-axis

X axisA (X,Y)(1,.875)

X-axis

Origing

.125 inch spacing

Page 4: g-code

Ordered Pairs(1.000,1.000

)( 1 125 625)

Ordered PairsA )(-1.125,.625)

B

C

D

(-.375,-.500)

(.750,-1.000)D

Page 5: g-code

3D Coordinate System (X Y Z)3D Coordinate System (X,Y,Z)

Z-axis

Y-axis

X-axis

Page 6: g-code

Basic Machine A es 3 a isBasic Machine Axes: 3 axisMilling Machines: 3 axis

X – axis (table left and right)

Y – axis (table in and out)Z – axis (usually the

spindle axis)

Page 7: g-code

Additional A esAdditional AxesA i ( l i b t X i )A – axis (angular axis about X - axis)B – axis (angular axis about Y – axis)( g )C – axis (angular axis about Z – axis)

U – axis (secondary axis parallel to X)( y p )V – axis (secondary axis parallel to Y)W i ( d i ll l t Z)W – axis (secondary axis parallel to Z)

Page 8: g-code

Milling Machines: 4 axisMilling Machines: 4 axis

Page 9: g-code

TerminologyTerminologyNC – Numerical ControlNC – Numerical ControlCNC – Computer Numerical ControlDNC – Direct Numerical ControlAPT Automatic Programmed ToolAPT – Automatic Programmed ToolCAD – Computer Aided DesignCAM – Computer Aided ManufacturingCIM Computer Integrated ManufacturingCIM – Computer Integrated Manufacturing

Page 10: g-code

Do nload Code SheetDownload Code Sheet

Click here to open Code Sheet

Page 11: g-code

G Code ProgrammingG - Code ProgrammingG C d P iG – Code Programming

Originally called the “Word Address” g yprogramming format.

Processed one line at a time sequentially.

Page 12: g-code

Common Format of a BlockCommon Format of a BlockSequence

#Preparatory Function

Dimension Words

Feed Rate

Spindle Function

Tool Function

Misc. Function

N50 G90 G01 X1.40Y2.25 F10 S1500 T01 M03

Individual WordsIndividual Words

Page 13: g-code

Reserved Code Words WorksheetN – Sequence or line numberG fG – Preparatory function

Di i W dDimension Words:X –YY –

Z –

Page 14: g-code

Word Address 1Word Address 1N Sequence or line numberN – Sequence or line number

A tag that identifies the beginning of a block of code It is used by operators to locate specificcode. It is used by operators to locate specific lines of a program when entering data or verifying the program operation.

G – Preparatory functionG words specify the mode in which the milling machine is to move along its programmed axes.

Page 15: g-code

Word Address 2Word Address 2Dimension WordsDimension Words

X – Distance or position in X directionY Distance or position in Y directionY – Distance or position in Y directionZ – Distance or position in Z direction

M – Miscellaneous functionsM words specify CNC machine functions notM words specify CNC machine functions not related to dimensions or axial movements.

Page 16: g-code

Word Address 3F Feed rate (inches per minute or millimeters per

Word Address 3F – Feed rate (inches per minute or millimeters per

minute)Rate at which cutting tool moves along an axisRate at which cutting tool moves along an axis.

S – Spindle speed (rpm – revolutions per minute)S Spindle speed (rpm revolutions per minute)Controls spindle rotation speed.

T – Tool numberSpecifies tool to be selectedSpecifies tool to be selected.

Page 17: g-code

Word Address 4I Circular cutting reference for x axis

Word Address 4I – Circular cutting reference for x axis

J – Circular cutting reference for y axis

K – Circular cutting reference for z axis

Page 18: g-code

G WordG WordG d d t ll th hi tG words or codes tell the machine to

perform certain functions. Most G words are modal which means they remain in effect until replaced by p yanother modal G code.

Page 19: g-code

Common G CodesCommon G CodesG00 Rapid positioning modeG00 – Rapid positioning mode

Tool is moved along the shortest route to programmed X Y Z position Usually NOTprogrammed X,Y,Z position. Usually NOT used for cutting.

G01 – Linear Interpolation modeG01 Linear Interpolation modeTool is moved along a straight-line path at programmed rate of speed.programmed rate of speed.

G02 – Circular motion clockwise (cw)G03 – Circular motion counter clockwise

(ccw)

Page 20: g-code

Common G Codes conCommon G Codes, con.,G17 – XY planeG18 – XZ planeG18 XZ planeG19 – YZ planeG20 – Inch ModeG21 – Metric ModeG21 Metric ModeG28 – Return to axis machine Zero

(H )(Home)

Page 21: g-code

G Codes G90 G91G Codes: G90, G91G90 Absolute Coordinate ReferenceG90 – Absolute Coordinate Reference

References the next position from an absolute zero point which is set once for the entirezero point which is set once for the entire program.

G91 Incremental Coordinate ReferenceG91 – Incremental Coordinate ReferenceReferences the next position from the previous positionposition.

Page 22: g-code

G Codes Canned C clesG Codes: Canned CyclesG80 Cancel canned cycleG80 – Cancel canned cycleG81 – Drilling cycleG83 P k d illi lG83 – Peck drilling cycleG84 – Tapping cycleG85 – Boring cycleG86 – Boring cycleg y

NOTE: A canned cycle stays in effect until y ycancelled by a G80.

Page 23: g-code

Canned C cles G81Canned Cycles: G81G81 Drilling CycleG81 – Drilling Cycle

Feed to depth, rapid return

Example of program code:N35 G81 X 500Y 500Z 1 000 R 100 F1 50N35 G81 X.500Y.500Z-1.000 R.100 F1.50N36 X1.000Y1.500N37 X1 500Y2 000N37 X1.500Y2.000N38 G80

Page 24: g-code

Canned C cles G83 G84Canned Cycles: G83, G84G83 Peck Drilling CycleG83 – Peck Drilling Cycle

Feed to an intermediate depth, rapid out, rapid back to just above previous depth feed to nextback to just above previous depth, feed to next depth, rapid out, repeat until reaching full depth.

G84 – Tapping CycleThis cycle creates internal threads in an existing y ghole.NOTE: One cannot over-ride the feed rate.

Page 25: g-code

Canned C cles G85 G86Canned Cycles: G85, G86G85 Boring CycleG85 - Boring Cycle

Feed to depth, feed back out.

G86 – Boring CycleG86 Boring CycleFeed to depth, rapid out.

Page 26: g-code

G C d C tt C tiG Codes: Cutter CompensationG40 C l tt di tG40 – Cancel cutter diameter

compensation.

G41 – Cutter compensation left.

G42 – Cutter compensation right.

Page 27: g-code

M WordM WordM words tell the machine to perform

certain machine related functions, such as: turn spindle on/off, coolant on/off, or stop/end program.on/off, or stop/end program.

Professional Development ID Code: 6006

Page 28: g-code

Common M ordsCommon M wordsM00 Programmed pauseM00 – Programmed pause

Automatically stops machine until operator pushes a button to resume program.p g

M01 – Optional stopA stop acted upon by the machine when operator has signaled this command by pushing a button.

M02 – End of programStops program when all lines of code are completed MustStops program when all lines of code are completed. Must be last command in program.

Page 29: g-code

Common M ordsM03 Turn spindle on

Common M wordsM03 – Turn spindle on

In clockwise direction

M04 Turn spindle onM04 – Turn spindle onIn counter clockwise direction

M05 St i dlM05 – Stop spindleUsually used prior to tool change or at end of program.

M06 – Tool changeStops program and calls for a tool change, either automatically or manuallyautomatically or manually.

Page 30: g-code

Common M ordsM08 Turns Accessory 1 on

Common M wordsM08 – Turns Accessory 1 on.M09 – Turns Accessory 1 off.

M10 – Turns Accessory 2 on.M11 T A 2 ffM11 – Turns Accessory 2 off.

M30 End of programM30 – End of programSimilar to M02 but M30 will also “rewind” the program. Must be last statement in program If used DO NOTMust be last statement in program. If used, DO NOT use M02.

Page 31: g-code

Zero PointsZero PointsP t ZPart Zero

– Used for absolute programming mode.U ll iti th t th t ll b l t– Usually a position on the part that all absolute coordinates are referenced to.

– Changes with different parts and programs– Changes with different parts and programs.

Machine Zero or Machine Home Position – Fixed for each machine from the manufacturer.– Not changeable.

Page 32: g-code

C tter Path GenerationCutter Path GenerationC tt th i t d b i thCutter path is generated by moving the

tool from point to point. The points are previously defined from the part drawing dimensions.g

Each line of code will show the destination point of where the tool will go to. g

Page 33: g-code

InterpolationInterpolationMethod of determining intermediate

points along a cutting path.p g g p

T th dTwo methods:• Linear interpolation – cut a path along a

ifi d l t ifi d f d tspecified angle at a specified feed rate.• Circular interpolation – cut a path along an arc

i l t ifi d f d tor circle at a specified feed rate.

Page 34: g-code

A is mo ements Ca tion!Axis movements: Caution!Multiple axis movements are possible.

“B t P ti ” i NOT t k 3 i“Best Practice” is NOT to make a 3-axis movement using one line of code.

Move to position using two axes, X,Y; th th Z ith dditi lthen move the Z with an additional line of code.

Page 35: g-code

E l 1 NC Bl kExample 1: NC Block

Page 36: g-code

T Vi NC Bl k .125 GRIDTop View NC Block .125 GRID SPACES

Origin (0,0)

Page 37: g-code

Do nload WorksheetDownload Worksheet

Click here to open Practice Exercises

Page 38: g-code

Worksheet Problem 1 .125 GRIDWorksheet Problem 1 .125 GRID SPACES

B( , )D( , ) I( , ) J( , )

K( , )

L( )L( , )

E( , )

A( , )

F( , )

Origin (0,0)

C( , )G( , )H( , )

Page 39: g-code

Pa se LessonPause Lesson

Page 40: g-code

E ample 1 Program NCExample 1: Program NCN01 G90 G80 T00N01 G90 G80 T00N02 G00 X0 Y3.000 Z1.000N03 M03 S1000

Page 41: g-code

E ample 1 Program NCExample 1: Program NCN01 G90 G80 T00N01 G90 G80 T00N02 G00 X0 Y3.000 Z1.000

N03 M03 S1000

N04 X.375 Y.250 Z1.000

N05 Z 100N05 Z.100

N06 G01 Z-.100 F5.00N07 Y1.750

Page 42: g-code

E ample 1 Program cont’dExample 1: Program cont’dN08 X1 250 Y 250N08 X1.250 Y.250N09 Y1.750N10 G00 Z.100N11 X2 625 Y 500N11 X2.625 Y.500N12 GO1 Z-.100N13 X2.375 Y2.50N14 X2.000

Page 43: g-code

E ample 1 Program cont’dExample 1: Program cont’dN15 X1 750 Y 500N15 X1.750 Y.500

N16 Y1.500

N17 X2.000 Y1.750

N18 X2.375

N19 X2.625 Y1.500

Page 44: g-code

E ample 1 conExample 1, con.,N20 G00 Z1 000N20 G00 Z1.000

N21 X0 Y3 000N21 X0 Y3.000

N22 M05

N23 M30

Page 45: g-code

E l 2 PLTW Bl kExample 2: PLTW Block

Page 46: g-code

Worksheet Problem 2 .250 GRID Worksheet Problem 2 SPACE

O i iOrigin

Page 47: g-code

E ample 2 Top VieExample 2: Top ViewC(

I( , )F( , )

K( , )J( , )

O(

M( , )

C( , )

B( ,

) ) O( , )

E( , )

) Q( , )

A( , )

)

D( , ) H( ,

G( , )L( ,

)P( ,

)N( , )Origin

) H( , )

.250 Grid Space

)

Page 48: g-code

Pa se LessonPause Lesson

Page 49: g-code

E ample 2 PLTWExample 2: PLTWN01 G90 G80 T01N01 G90 G80 T01N02 G00 X0 Y0 Z1.000N03 M03 S1000N04 X 750 Y 500 Z1 000N04 X.750 Y.500 Z1.000N05 Z.100N06 G01 Z-.250 F5.00N07 Y2.500N07 Y2.500

Page 50: g-code

E ample 2 PLTW cont’dExample 2: PLTW cont’dN08 X1 250N08 X1.250N09 G02 X1.250 Y1.500 I1.250 J2.000N10 G01 X.750N11 G00 Z 100N11 G00 Z.100N12 X2.250 Y2.500N13 G01 Z-.250N14 Y.500N14 Y.500

Page 51: g-code

E ample 2 Program cont’dExample 2: Program cont’dN15 X3.250N16 G00 Z.100N16 G00 Z.100N17 X4.000N18 G01 Z-.250N19 Y2 500N19 Y2.500N20 X3.500N21 X4.500

Page 52: g-code

E ample 2 PLTW cont’dExample 2: PLTW cont’dN22 G00 Z.100N23 X5.000 Y2.500N23 X5.000 Y2.500N24 G01 Z-.250N25 X5.500 Y.500N26 X5 750 Y1 500N26 X5.750 Y1.500N27 X6.000 Y.500N28 X6.500 Y2.500

Page 53: g-code

E ample 2 PLTW cont’dExample 2: PLTW cont’dGN29 G00 Z1.000

N30 X0 Y0N30 X0 Y0N31 M05N32 M30

Page 54: g-code

Curriculum Alignment:

Unit 2: CNC Machining

Section 2.3 – CNC Machining

P P i t I t d ti t CNCPowerPoint – Introduction to CNC

PowerPoint – CNC Programming

Page 55: g-code

R fReferences:

Oberg, E. & Jones F. D. & Horton, H. L. & Ryffell, H H (2000) Machinery’s Handbook 26thH. H. (2000). Machinery s Handbook, 26ed., New York, NY: Industrial Press Inc.

Valentino, J.V. & Goldenberg, J. (2003). Introduction to Computer Numerical Control (CNC), 3rd ed., Upper Saddle River, NJ: Prentice Hall

Page 56: g-code

Credits:Writer: Bob Arrendondo

Content Editor: Donna E. Scribner

Narration: Donna E. Scribner

PLTW Editor: Ed Hughesg

Production: CJ Amarosa

Video Production: CJ AmarosaVideo Production: CJ Amarosa

Audio: CJ Amarosa

P j t M D E S ibProject Manager: Donna E. Scribner


Recommended