CNC Machine Language CNC Machine Language GCode is

  • Slides: 20
Download presentation
CNC Machine Language

CNC Machine Language

CNC Machine Language

CNC Machine Language

G-Code is one of a number of computer l code languages that are used

G-Code is one of a number of computer l code languages that are used to instruct CNC machining devices what motions they need to perform such as work coordinates, canned cycles, and multiple repetitive cycles. Industry has standardized on GCode as its basic set of CNC machine codes.

G-Code is the most popular programming l language used for programming CNC machinery. Some

G-Code is the most popular programming l language used for programming CNC machinery. Some G words alter the state of the machine so that it changes from cutting straight lines to cutting arcs. Other G words cause the interpretation of numbers as millimeters rather than inches. Some G words set or remove tool length or diameter offsets.

in a computer regiester There are other codes; the type codes can be thought

in a computer regiester There are other codes; the type codes can be thought of like X absolute position¡ Y absolute position¡ Z absolute position¡ A position (rotary around X)¡ B position (rotary around Y)¡ C position (rotary around Z)¡ U Relative axis parallel to X)¡

V Relative axis parallel to Y¡ W Relative axis parallel to Z¡ M code

V Relative axis parallel to Y¡ W Relative axis parallel to Z¡ M code (another "action" register or ¡ Machine code(*))(otherwise referred to as a ""Miscellaneous" function F feed rate¡ S spindle speed¡ N line number¡ R Arc radius or optional word passed to a ¡ subprogram/canned cycle P Dwell time or optional word passed to a ¡ subprogram/canned

T Tool selection¡ I Arc data X axis¡. J Arc data Y axis¡ K

T Tool selection¡ I Arc data X axis¡. J Arc data Y axis¡ K Arc data Z axis, or optional word passed to a ¡ subprogram/canned cycle D Cutter diameter/radius offset¡ H Tool length offset¡

Below is a complete listing of current codes G 00 Rapid Linear Interpolation l

Below is a complete listing of current codes G 00 Rapid Linear Interpolation l G 01 Linear Interpolation l G 02 Clockwise Circular Interpolation l G 03 Counter Clockwise Circular l Interpolation G 04 Dwell l G 05 High Speed Machining Mode l G 10 Offset Input By Program l

G 12 Clockwise Circle With Entrance And l Exit Arcs G 13 Counter Clockwise

G 12 Clockwise Circle With Entrance And l Exit Arcs G 13 Counter Clockwise Circle With l Entrance And Exit Arcs G 17 X-Y Plane Selection l G 18 Z-X Plane Selection l G 19 Y-Z Plane Selection l G 28 Return To Reference Point l G 34 Special Fixed Cycle (Bolt Hole Circle) l

G 35 Special Fixed Cycle (Line At Angle) l G 36 Special Fixed Cycle

G 35 Special Fixed Cycle (Line At Angle) l G 36 Special Fixed Cycle (Arc) l G 37 Special Fixed Cycle (Grid) l G 40 Tool Radius Compensation Cancel l G 41 Tool Radius Compensation Left l G 42 Tool Radius Compensation Right l G 43 Tool Length Compensation l

G 44 Tool Length Compensation Cancel l G 45 Tool Offset Increase l G

G 44 Tool Length Compensation Cancel l G 45 Tool Offset Increase l G 46 Tool Offset Decrease l G 50. 1 Programmed Mirror Image Cancel l G 51. 1 Programmed Mirror Image l On. G 52 Local Coordinate Setting G 54 - G 59 Work Coordinate Registers 1 l Thru 6 G 60 Unidirectional Positioning l G 61 Exact Stop Check Mode l

G 65 Macro Call (Non Modal) l G 66 Macro Call (Modal) l G

G 65 Macro Call (Non Modal) l G 66 Macro Call (Modal) l G 68 Programmed Coordinate Rotation l G 69 Coordinate Rotation Cancel G 73 Fixed Cycle (Step) l G 74 Fixed Cycle (Reverse Tapping) l G 76 Fixed Cycle (Fine Boring) l G 80 Fixed Cycle Cancel l G 81 Fixed Cycle (Drilling / Spot Drilling) l G 82 Fixed Cycle (Drilling / Counter Boring) l G 83 Fixed Cycle (Deep Hole Drilling) l G 84 Fixed Cycle (Tapping) l G 85 Fixed Cycle (Boring) l

G 86 Fixed Cycle (Boring) l G 87 Fixed Cycle (Back Boring) l G

G 86 Fixed Cycle (Boring) l G 87 Fixed Cycle (Back Boring) l G 88 Fixed Cycle (Boring) l G 89 Fixed Cycle (Boring) l G 90 Absolute Value Command l G 91 Incremental Value Command G 92 Work Offset Set l

G 107 User macro 1 (sine) sin l G 108 User macro 1 (cosine)

G 107 User macro 1 (sine) sin l G 108 User macro 1 (cosine) cos l G 109 User macro 1 (arc tangent) tan l G 110 User macro (square root) l G 200 User macro 1 (unconditional branch) l G 201 User macro 1 (zero condition branch) l G 202 User macro (negative condition l branch)

Basic ISO CNC Code M 03, M 04, M 05 Spindle CW, Spindle l

Basic ISO CNC Code M 03, M 04, M 05 Spindle CW, Spindle l CCW, Spindle Stop M 08, M 09 Coolant/lubricant On, l Coolant/lubricant Off M 02 Program Stop l M 30 Program end, rewind l M 98 Subprogram call l M 99 Return to call program l

M 00, M 01 Program stop, optional stop l G 96, G 97 Constant

M 00, M 01 Program stop, optional stop l G 96, G 97 Constant surface speed, l Constant Spindle speed G 50 Maximum spindle speed l G 95, G 94 Feed mm per revolution, feed l mm/min G 00, G 01 rapid movement, Linear l Interpolation (cutting in a straight line) F Feed l S Spindle Speed l

Example This is a generic program that demonstrates the use of G-Code to turn

Example This is a generic program that demonstrates the use of G-Code to turn a 1" diameter X 1" long part. Assume that a bar of material is in the machine and that the bar is slightly oversized in length and diameter and that the bar protrudes by more than 1" from the face of the chuck. (Caution: This is generic, it might not work on any real machine! Pay particular attention to point 5 below. ) l

Line N 01 N 02 N 03 N 04 N 05 N 06 N

Line N 01 N 02 N 03 N 04 N 05 N 06 N 07 N 08 Code M 216 l G 00 X 20 Z 20 l G 50 S 2000 l M 01 l T 0303 M 6 l G 96 S 854 M 42 M 03 M 08 l G 00 X 1. 1 Z 1. 1 l G 01 Z 1. 0 F. 05 l

Line N 09 N 10 N 11 N 13 N 14 N 15 N

Line N 09 N 10 N 11 N 13 N 14 N 15 N 16 Code X 0. 0 l G 00 Z 1. 1 l X 1. 0 N 12 G 01 Z 0. 0 l M 05 M 09 l G 28 G 91 X 0 l M 215 l M 30 l