KODEX
The machinist's reference bible. G-code, CNC parameters, mechanical engineering formulas, plasma & laser cutting settings, welding procedures, and fabrication standards — unified in one searchable knowledge base.
G-codes (preparatory codes) direct the machine's physical motion and positioning. The following table covers the most common modal and non-modal G-codes per FANUC / ISO 6983 conventions. Always verify against your specific controller's documentation.
| Code | Function | Type | Example |
|---|---|---|---|
| G00 | Rapid Positioning | Modal (0) | G00 X10 Y10 Z5 |
| G01 | Linear Interpolation | Modal (0) | G01 X50 Y30 F200 |
| G02 | Circular Interpolation CW | Modal (0) | G02 X20 Y20 I5 J0 F150 |
| G03 | Circular Interpolation CCW | Modal (0) | G03 X20 Y20 R10 F150 |
| G04 | Dwell (pause) | Non-modal | G04 P500 |
| G17 | XY Plane Selection | Modal (2) | G17 |
| G18 | XZ Plane Selection | Modal (2) | G18 |
| G19 | YZ Plane Selection | Modal (2) | G19 |
| G20 | Inch Units | Modal (6) | G20 |
| G21 | Millimetre Units | Modal (6) | G21 |
| G28 | Return to Machine Home | Non-modal | G28 Z0 |
| G40 | Cancel Cutter Compensation | Modal (7) | G40 |
| G41 | Cutter Comp Left | Modal (7) | G41 D01 |
| G42 | Cutter Comp Right | Modal (7) | G42 D01 |
| G43 | Tool Length Offset + | Modal (8) | G43 H01 Z5 |
| G49 | Cancel Tool Length Offset | Modal (8) | G49 |
| G54–G59 | Work Coordinate Systems | Modal (14) | G54 |
| G73 | High-Speed Peck Drill Cycle | Modal (9) | G73 X0 Y0 Z-20 Q3 R2 F80 |
| G74 | Left-Hand Tapping Cycle | Modal (9) | G74 X0 Y0 Z-15 F125 |
| G76 | Fine Boring Cycle | Modal (9) | G76 X0 Z-20 R0.5 F50 |
| G80 | Cancel Canned Cycle | Modal (9) | G80 |
| G81 | Drill Cycle | Modal (9) | G81 X10 Y10 Z-20 R2 F100 |
| G83 | Deep Peck Drill Cycle | Modal (9) | G83 Z-40 Q5 R2 F60 |
| G84 | Tapping Cycle | Modal (9) | G84 Z-15 F125 |
| G90 | Absolute Positioning | Modal (3) | G90 |
| G91 | Incremental Positioning | Modal (3) | G91 |
| G92 | Set Work Coordinate Origin | Non-modal | G92 X0 Y0 Z0 |
| G94 | Feed per Minute | Modal (5) | G94 |
| G95 | Feed per Revolution | Modal (5) | G95 |
| G96 | Constant Surface Speed | Modal (13) | G96 S200 |
| G97 | Constant Spindle Speed | Modal (13) | G97 S1500 |
| G98 | Return to Initial Plane | Modal (10) | G98 |
| G99 | Return to R Plane | Modal (10) | G99 |
M-codes (miscellaneous functions) control machine auxiliary functions: spindle, coolant, tool change, and program flow.
| Code | Function | Notes |
|---|---|---|
| M00 | Program Stop | Stops spindle, coolant, feed — requires cycle start to resume |
| M01 | Optional Stop | Active only when Optional Stop switch is ON |
| M02 | End of Program | Returns control to start, may reset offsets |
| M03 | Spindle CW | M03 S1500 — start spindle clockwise at 1500 RPM |
| M04 | Spindle CCW | For left-hand tools or reverse tapping |
| M05 | Spindle Stop | Decelerates and stops spindle |
| M06 | Tool Change | M06 T02 — change to tool 2 |
| M07 | Coolant Mist ON | Activates mist coolant |
| M08 | Flood Coolant ON | Activates flood coolant |
| M09 | Coolant OFF | Deactivates all coolant |
| M19 | Spindle Orient | Positions spindle at defined angle for tool change |
| M30 | End of Program + Reset | Ends program and resets to start, preferred over M02 |
| M48 | Enable Override | Re-enables feed/speed override controls |
| M49 | Disable Override | Locks feed/speed overrides at 100% |
| M98 | Call Subprogram | M98 P1234 L3 — call O1234 three times |
| M99 | Return from Subprogram | Returns to main program after M98 call |
O0001 ( Program number )
N10 G21 G17 G40 G49 G80 G90 ( Safety line: mm, XY, cancel comp/TLO/cycles, absolute )
N20 G28 G91 Z0 ( Return Z to home )
N30 T01 M06 ( Tool change: T01 face mill )
N40 G54 ( Work offset 1 )
N50 G43 H01 Z50 ( Tool length offset, rapid to Z50 )
N60 M03 S1200 ( Spindle CW 1200 RPM )
N70 M08 ( Flood coolant ON )
N80 G00 X-10 Y0 ( Rapid to start XY )
N90 G00 Z2 ( Rapid to Z clearance )
N100 G01 Z-0.5 F500 ( Feed to depth 0.5mm )
N110 G01 X110 F800 ( Face mill pass )
N120 G00 Z50 ( Rapid retract )
N130 M05 ( Spindle stop )
N140 M09 ( Coolant off )
N150 G28 G91 Z0 ( Z home )
N160 M30 ( End + reset )
| Material | HSS SFM | Carbide SFM | IPT (0.5″ end mill) | Coolant |
|---|---|---|---|---|
| Aluminum 6061 | 200–500 | 600–1200 | 0.002–0.005″ | Air/flood |
| Mild Steel (A36) | 50–100 | 200–400 | 0.001–0.003″ | Flood |
| Stainless 304 | 30–60 | 100–200 | 0.0008–0.002″ | Flood (sulfur-free) |
| Titanium Ti-6Al-4V | 20–40 | 60–120 | 0.0005–0.0015″ | High-pressure flood |
| Cast Iron | 50–90 | 200–400 | 0.001–0.003″ | Dry or air |
| Brass | 150–300 | 500–800 | 0.002–0.005″ | Dry or mist |
| HDPE / Nylon | 300–600 | 800–1500 | 0.004–0.010″ | Air / dry |
| Carbon Fiber (CFRP) | — | 300–600 | 0.001–0.003″ | Dry (compressed air) |
ISO 286 defines the system of limits and fits for cylindrical features. The fit type is specified by a fundamental deviation letter and an IT grade number. Hole-basis system is standard; the hole is held constant and the shaft is adjusted.
| Fit Type | ISO Symbol (Ø50) | Description | Typical Use |
|---|---|---|---|
| Loose Running | H11/c11 | Large clearance; free relative motion | Agricultural, rough machinery |
| Free Running | H9/d9 | Good clearance; no precision required | Shafts in plain bearings, large temp range |
| Close Running | H8/f7 | Moderate clearance; lubrication needed | Journal bearings, gear shafts |
| Sliding | H7/g6 | Small clearance; accurate location + sliding | Precision slides, valve spindles |
| Locational Clearance | H7/h6 | Smallest clearance; accurate stationary location | Spigots, flanges, dowel pins |
| Locational Transition | H7/k6 | May be clearance or interference | Hubs on shafts (easily assembled) |
| Locational Interference | H7/p6 | Light interference; rigidity & alignment | Thin-wall bushings, light press fits |
| Medium Drive | H7/s6 | Medium interference; press-fit assembly | Standard press fits; semi-permanent |
| Force / Shrink | H7/u6 | High interference; heavy press or heat fit | High-torque drive fits; permanent |
| Thread | Pitch (mm) | Tap Drill (mm) | Clearance Drill | TPI (if UNC/UNF) |
|---|---|---|---|---|
| M3 | 0.5 | 2.5 | 3.2 | — |
| M4 | 0.7 | 3.3 | 4.3 | — |
| M5 | 0.8 | 4.2 | 5.3 | — |
| M6 | 1.0 | 5.0 | 6.4 | — |
| M8 | 1.25 | 6.75 | 8.5 | — |
| M10 | 1.5 | 8.5 | 10.5 | — |
| M12 | 1.75 | 10.2 | 13.0 | — |
| M16 | 2.0 | 14.0 | 17.0 | — |
| M20 | 2.5 | 17.5 | 21.0 | — |
| 1/4″-20 UNC | 1.27 | 5.1 (#7) | 6.8 (17/64) | 20 |
| 5/16″-18 UNC | 1.41 | 6.9 (F) | 8.3 | 18 |
| 3/8″-16 UNC | 1.59 | 8.5 (5/16) | 9.9 | 16 |
| 1/2″-13 UNC | 1.95 | 11.1 (27/64) | 13.5 | 13 |
| 1/4″-28 UNF | 0.907 | 5.4 (#3) | 6.8 | 28 |
| 3/8″-24 UNF | 1.058 | 8.7 (Q) | 9.9 | 24 |
| Material | Tensile UTS (MPa) | Yield (MPa) | Hardness | Density (g/cm³) | Note |
|---|---|---|---|---|---|
| Steel A36 / S275 | 400–550 | 250 | ~130 HB | 7.85 | Structural mild steel |
| Steel 4140 (Ann.) | 655 | 415 | ~197 HB | 7.85 | Chromoly, heat-treatable |
| Steel 4140 (HT) | 1020 | 655 | ~302 HB | 7.85 | Hardened & tempered |
| Stainless 304 | 515 | 205 | ~201 HB | 7.93 | Austenitic, non-magnetic |
| Stainless 316 | 515 | 205 | ~217 HB | 7.99 | Molybdenum; marine grade |
| Aluminum 6061-T6 | 310 | 276 | ~95 HRB | 2.70 | Most common structural Al |
| Aluminum 7075-T6 | 572 | 503 | ~150 HB | 2.81 | Aerospace; high-strength |
| Copper C110 | 220 | 70 | ~40 HRB | 8.94 | Electrolytic tough pitch |
| Brass C360 | 385 | 310 | ~78 HRB | 8.50 | Free machining brass |
| Ti-6Al-4V | 950 | 880 | ~36 HRC | 4.43 | Aerospace titanium alloy |
| Cast Iron (Grey) | 100–200 | — | ~200 HB | 7.20 | Brittle; excellent compression |
| HDPE | 22–31 | 18–25 | ~65 Shore D | 0.95 | Food-safe plastic |
| Delrin (Acetal) | 62–76 | — | ~80 Shore D | 1.42 | Precision plastic; low friction |
Plasma cutting uses an ionized gas jet (plasma arc) to melt and expel metal. Air plasma works on mild steel, stainless, and aluminum. Nitrogen and argon-hydrogen mixes improve cut quality on stainless and thicker materials. Standoff height (torch-to-work distance) critically affects cut quality — typically 1.5–4mm for most systems.
| Material | Thickness | Current (A) | Speed (mm/min) | Gas | Kerf (mm) |
|---|---|---|---|---|---|
| Mild Steel | 3mm | 40A | 3500–4500 | Air | 1.5–2.0 |
| Mild Steel | 6mm | 50–60A | 1500–2500 | Air | 1.8–2.5 |
| Mild Steel | 12mm | 80–100A | 700–1200 | Air | 2.5–3.5 |
| Mild Steel | 25mm | 100–130A | 200–500 | Air / O₂ | 3.0–4.5 |
| Stainless 304 | 3mm | 45A | 3000–4000 | N₂ | 1.8–2.2 |
| Stainless 304 | 10mm | 80A | 900–1400 | N₂ | 2.5–3.0 |
| Aluminum | 3mm | 40A | 4000–5500 | Air / N₂ | 1.5–2.0 |
| Aluminum | 10mm | 70A | 1500–2500 | Air / N₂ | 2.5–3.5 |
CO₂ lasers (10.6µm) excel at non-metals (acrylic, wood, fabric). Fiber lasers (1.06µm) are superior for metals. Diode lasers are low-cost entry-level for wood/leather. Cut quality is governed by power (W), speed (mm/min), focus point, and assist gas (O₂ for mild steel, N₂ for stainless/aluminum clean edge).
| Material | Thickness | Power (W) | Speed (mm/min) | Assist Gas | Kerf (mm) |
|---|---|---|---|---|---|
| Acrylic (CO₂) | 3mm | 40–60W | 8000–15000 | Air | 0.1–0.2 |
| Acrylic (CO₂) | 10mm | 100–150W | 2000–4000 | Air | 0.2–0.3 |
| MDF (CO₂) | 6mm | 60–80W | 5000–10000 | Air | 0.2–0.4 |
| Mild Steel (Fiber) | 1mm | 500–1000W | 10000–25000 | O₂ | 0.1–0.15 |
| Mild Steel (Fiber) | 3mm | 1000–2000W | 5000–12000 | O₂ | 0.15–0.25 |
| Mild Steel (Fiber) | 6mm | 2000–3000W | 2000–5000 | O₂ / N₂ | 0.25–0.4 |
| Stainless (Fiber) | 2mm | 1000–2000W | 4000–9000 | N₂ | 0.12–0.2 |
| Aluminum (Fiber) | 2mm | 1500–3000W | 5000–10000 | N₂ | 0.15–0.25 |
| Process | Code | Positions | Best For | Filler / Electrode |
|---|---|---|---|---|
| MIG / GMAW | 135/136 | All | Mild steel, fab shops, high production | ER70S-6 wire (mild), ER308L (SS) |
| TIG / GTAW | 141 | All | Precision, thin gauge, SS, Al, Ti | ER70S-2 (steel), ER4043/5356 (Al) |
| Stick / SMAW | 111 | All | Site work, dirty/rusty metal, thick plate | E6010, E6011, E7018 |
| Flux-Core / FCAW | 136 | All (gas); 1F–2F (self) | Structural, outdoor, thick gauge | E71T-1 (gas), E71T-11 (self) |
| SAW | 121 | 1G, 1F | Heavy plate, automated, high deposition | Wire + flux powder |
| Plasma Arc / PAW | 15 | All | Precision thin sheet, keyhole mode | Same as TIG |
| Oxy-Fuel / OAW | 311 | All | Thin sheet, brazing, fieldwork | OA rods, bronze brazing |
| Material Thickness | Wire Dia (mm) | Voltage (V) | Wire Speed (m/min) | Gas Flow (L/min) |
|---|---|---|---|---|
| 0.8mm | 0.6 | 14–16 | 3–4 | 8–10 |
| 1.5mm | 0.8 | 16–18 | 4–6 | 10–12 |
| 3mm | 0.8–1.0 | 18–22 | 6–9 | 12–14 |
| 6mm | 1.0–1.2 | 22–26 | 8–12 | 14–16 |
| 10mm | 1.2 | 26–30 | 12–16 | 14–18 |
| 20mm+ | 1.2–1.6 | 28–34 | 14–20 | 16–20 |
| Material | Soft / Annealed | Semi-Hard | Hard |
|---|---|---|---|
| Mild Steel | 0.35–0.40 | 0.41–0.44 | 0.45–0.50 |
| Stainless Steel | 0.38–0.42 | 0.43–0.47 | 0.48–0.50 |
| Aluminum | 0.33–0.38 | 0.39–0.43 | 0.44–0.50 |
| Copper | 0.35–0.40 | — | 0.41–0.47 |
| Brass | 0.35–0.42 | — | 0.43–0.50 |
| Standard | Body | Covers |
|---|---|---|
| ISO 286 | ISO | Limits & fits for cylindrical features |
| ISO 1101 | ISO | GD&T — geometrical tolerancing |
| ASME Y14.5 | ASME | GD&T (US standard, dimensioning and tolerancing) |
| ISO 6983 | ISO | G-code / NC programming language |
| AWS D1.1 | AWS | Structural welding code — steel |
| AWS D1.2 | AWS | Structural welding code — aluminum |
| ISO 2553 | ISO | Weld symbols on drawings |
| ASME B1.1 | ASME | Unified inch screw threads (UN/UNR) |
| ISO 68-1 | ISO | Metric screw thread general plan |
| ASTM A36 | ASTM | Structural carbon steel specification |
| EN 10025 | CEN | European structural steel products |
| ISO 9013 | ISO | Thermal cutting — classification and quality |