Z&Z STROTECZ&Z STROTEC
HomeKnowledge › G-Code Quick Reference

G-Code Quick Reference

G-Code 快速參考 · G-Code 빠른 참조

Published: 2026-06-29 · Written by Z&Z STROTEC

View interactive version · 完整互動版 · 인터랙티브 버전 →

What is G-Code?

G-code (RS-274) is the standard CNC programming language. G-codes control machine movement; M-codes control machine functions (spindle, coolant, etc.).

Essential G-Codes — CNC Lathe (Turning)

  • G00: Rapid positioning (no cutting)
  • G01: Linear interpolation (cutting feed)
  • G02 / G03: Circular interpolation CW / CCW
  • G04: Dwell (P = milliseconds)
  • G20 / G21: Inch / Metric units
  • G32: Thread cutting
  • G40 / G41 / G42: Tool nose radius compensation cancel / left / right
  • G70: Finishing cycle
  • G71: Rough turning cycle (OD)
  • G72: Rough facing cycle
  • G74: Peck drilling / grooving cycle
  • G76: Thread cutting cycle
  • G90 / G91: Absolute / Incremental mode
  • G96: Constant surface speed (CSS)
  • G97: Constant spindle speed (RPM)
  • G98 / G99: Feed per minute / Feed per revolution

Essential M-Codes — CNC Lathe

  • M00: Program stop
  • M02 / M30: End of program
  • M03 / M04: Spindle CW / CCW
  • M05: Spindle stop
  • M08 / M09: Coolant ON / OFF
  • M10 / M11: Chuck clamp / unclamp

Cutting Speed Formula

  • RPM = (Vc × 1000) ÷ (π × D)
  • Example: Vc 200 m/min on ∅50mm → RPM = (200 × 1000) ÷ (3.14 × 50) = 1,274 RPM
  • Feed rate (mm/min) = RPM × f (mm/rev)

Typical Cutting Conditions

  • Steel S45C: Vc 150–200 m/min, f 0.15–0.3 mm/rev, ap 1–3mm
  • Stainless SUS304: Vc 80–130 m/min, f 0.1–0.2 mm/rev, ap 0.5–2mm
  • Aluminum: Vc 300–600 m/min, f 0.1–0.3 mm/rev, ap 1–5mm
  • Cast Iron: Vc 100–180 m/min, f 0.15–0.3 mm/rev, ap 1–4mm
繁體中文

什麼是 G-Code?

G-code(RS-274)是標準的 CNC 程式語言。G 碼控制機台移動;M 碼控制機台功能(主軸、切削液等)。

CNC 車床基本 G 碼

  • G00:快速定位(非切削)
  • G01:直線插補(切削進給)
  • G02 / G03:圓弧插補 順時針 / 逆時針
  • G04:暫停(P = 毫秒)
  • G20 / G21:英制 / 公制單位
  • G32:車牙
  • G40 / G41 / G42:刀尖補正取消 / 左 / 右
  • G70:精車循環
  • G71:外徑粗車循環
  • G72:端面粗車循環
  • G74:啄鑽 / 切槽循環
  • G76:複合車牙循環
  • G90 / G91:絕對 / 增量模式
  • G96:恆表面速度(CSS)
  • G97:固定主軸轉速(RPM)
  • G98 / G99:每分鐘進給 / 每轉進給

CNC 車床基本 M 碼

  • M00:程式暫停
  • M02 / M30:程式結束
  • M03 / M04:主軸正轉 / 反轉
  • M05:主軸停止
  • M08 / M09:切削液開 / 關
  • M10 / M11:夾頭夾緊 / 鬆開

切削速度公式

  • RPM = (Vc × 1000) ÷ (π × D)
  • 範例:Vc 200 m/min、∅50mm → RPM = (200 × 1000) ÷ (3.14 × 50) = 1,274 RPM
  • 進給率(mm/min)= RPM × f(mm/rev)

典型切削條件

  • S45C 鋼:Vc 150–200 m/min,f 0.15–0.3 mm/rev,ap 1–3mm
  • SUS304 不鏽鋼:Vc 80–130 m/min,f 0.1–0.2 mm/rev,ap 0.5–2mm
  • 鋁合金:Vc 300–600 m/min,f 0.1–0.3 mm/rev,ap 1–5mm
  • 鑄鐵:Vc 100–180 m/min,f 0.15–0.3 mm/rev,ap 1–4mm
한국어

G-Code란?

G-Code(RS-274)는 표준 CNC 프로그래밍 언어입니다. G코드는 기계 이동을 제어하고, M코드는 기계 기능(주축, 절삭유 등)을 제어합니다.

필수 G코드 — CNC 선반 (선삭)

  • G00: 급속 위치결정 (절삭 없음)
  • G01: 직선 보간 (절삭 이송)
  • G02 / G03: 원호 보간 시계 방향 / 반시계 방향
  • G04: 드웰 (P = 밀리초)
  • G20 / G21: 인치 / 미터 단위
  • G32: 나사 절삭
  • G40 / G41 / G42: 공구 노즈 반경 보정 취소 / 왼쪽 / 오른쪽
  • G70: 정삭 사이클
  • G71: 외경 황삭 사이클
  • G72: 단면 황삭 사이클
  • G74: 팩 드릴링 / 홈 파기 사이클
  • G76: 나사 절삭 사이클
  • G90 / G91: 절대 / 증분 모드
  • G96: 일정 절삭 속도 (CSS)
  • G97: 일정 주축 회전수 (RPM)
  • G98 / G99: 분당 이송 / 회전당 이송

필수 M코드 — CNC 선반

  • M00: 프로그램 정지
  • M02 / M30: 프로그램 종료
  • M03 / M04: 주축 정회전 / 역회전
  • M05: 주축 정지
  • M08 / M09: 절삭유 ON / OFF
  • M10 / M11: 척 클램프 / 언클램프

절삭 속도 공식

  • RPM = (Vc × 1000) ÷ (π × D)
  • 예시: Vc 200 m/min, ∅50mm → RPM = (200 × 1000) ÷ (3.14 × 50) = 1,274 RPM
  • 이송 속도 (mm/min) = RPM × f (mm/rev)

일반 절삭 조건

  • S45C 강: Vc 150~200 m/min, f 0.15~0.3 mm/rev, ap 1~3mm
  • SUS304 스테인리스: Vc 80~130 m/min, f 0.1~0.2 mm/rev, ap 0.5~2mm
  • 알루미늄: Vc 300~600 m/min, f 0.1~0.3 mm/rev, ap 1~5mm
  • 주철: Vc 100~180 m/min, f 0.15~0.3 mm/rev, ap 1~4mm
G-codeM-codeCNC programmingturningmillingcutting speed
Next step  ·  下一步  ·  다음 단계
Have a specification in hand?
手上已經有規格了嗎?  ·  사양이 이미 정해져 있으십니까?
Send us the machine model, the part number or a photo from the floor. We will come back on what is available and what it costs.
把機台型號、零件料號或現場照片寄給我們,我們會回覆供貨狀況與價格。
장비 모델명, 부품 번호 또는 현장 사진을 보내주시면 공급 가능 여부와 가격을 회신드립니다.
WHY THROUGH Z&Z  ·  為什麼透過萬洋  ·  Z&Z를 통하는 이유

Multi-brand selection rather than one factory, spec and compatibility checks in writing, a test cut and inspection at the plant before the machine ships, export documentation, and the same part number still available years later. Installation and after-sales in Korea, Brazil, Switzerland and Argentina run through local agents; for other markets we supply parts and components.

不綁單一工廠的多品牌選型、白紙黑字的規格與相容性確認、出貨前在工廠端試車驗機、出口文件,以及數年後仍拿得到的同一料號。韓國、巴西、瑞士、阿根廷的安裝與售後由在地服務商執行,其他市場我們供應零件與零組件。

단일 공장에 묶이지 않는 다중 브랜드 선정, 문서로 남기는 사양·호환성 확인, 선적 전 공장 시운전과 검사, 수출 서류, 그리고 수년 뒤에도 확보 가능한 동일 품번. 한국·브라질·스위스·아르헨티나의 설치와 애프터서비스는 현지 대리점이 담당하며, 그 외 시장에는 부품을 공급합니다.