This printable library is a “copy-paste + adapt” collection of proven, crash-resistant CNC program start/end blocks for common real-world setups. It is written to be practical: every block includes safe state resets, predictable tool changes, and retract patterns that minimize surprises. You MUST adapt values (tool numbers, offsets, spindle speeds, coolant codes, retract heights) to your machine, post, and shop standards. Nothing here replaces dry-run, graphics verify, and safe proving procedures.
GLOBAL RULES (READ ONCE, USE FOREVER)
1) Always know which coordinate system you’re in:
- Machine coordinates (G53) move in machine reference, ignoring work offsets.
- Work coordinates (G54–G59 / G54.1 Px) move relative to your part zero.
2) “G00 Z-100” is NOT universally safe:
- In work coordinates, Z-100 means 100 units BELOW part zero → often a crash.
- For safe retracts, use positive Z in WCS (e.g., Z100.0) OR use G53 to a known machine safe Z.
- If you must go below Z0 (negative Z), do it ONLY in controlled feed (G01) with verified clearance.
3) Safe retraction sequencing:
- Retract Z first (away from part), THEN X/Y moves.
- Prefer a known machine safe Z via G53 (or G28) before large XY rapids.
4) Modal resets reduce “mystery behavior”:
- Reset plane (G17/G18/G19), absolute/incremental (G90/G91), feed mode (G94/G95), cutter comp (G40), length comp (G49), cycles (G80), scaling/rotation (G50/G69), smoothing modes, etc.
5) Always define spindle/coolant explicitly per operation:
- Don’t assume previous tool left the correct M03/M04/M08 state.
PLACEHOLDERS (REPLACE THESE)
[WCS] = G54 / G55 / G54.1 Pn
[T##] = tool number
[H##]/[D##]= length/radius offsets
[S####] = RPM
[F###] = feed
[SAFE_Z] = known safe retract in WCS (e.g., Z100.0) OR G53 Z0.
[SAFE_XY] = safe XY park away from clamps/fixtures
[COOLANT] = M08 / M07 / M88 (TSC) etc.
[STOP] = M00 optional stop / M01 optional stop
[PROVE] = reduce rapid override + single block during prove-out
A) FANUC-STYLE 3-AXIS MILL — SAFE START (GENERAL PURPOSE)
(— SAFE START / HEADER —)
%
O____ (PART NAME / REV / DATE)
(SETUP: FIXTURE = _ MATERIAL = PROGRAMMER = ) (TOOLS: T01= T02=__ …)
(— SAFETY LINE —)
G90 G17 G21 G40 G49 G80 G94
(G21=mm; use G20 for inch)
(OPTIONAL: cancel coordinate rotation/scaling if used)
G69 (cancel G68 rotation, if your control supports it)
G50 (cancel scaling, if used on your control)
(OPTIONAL: cancel smoothing modes if used)
(— GO TO A KNOWN SAFE POSITION BEFORE ANY TOOL CHANGE —)
G53 Z0. (machine safe Z; use the machine’s safe Z reference)
(OPTIONAL: park XY in machine coords if your shop uses it)
G53 X0. Y0. (ONLY if your machine uses safe X0 Y0 park)
(— TOOL CHANGE BLOCK TEMPLATE —)
T[T##] M06
(— SPINDLE / COOLANT / WCS / LENGTH COMP —)
[WCS]
S[S####] M03
G43 H[H##] Z[SAFE_Z]
[COOLANT]
(OPTIONAL: stop for first-article prove)
M01
B) FANUC-STYLE 3-AXIS MILL — SAFE END (STANDARD)
(— END / RESET —)
M09 (coolant off)
G91 (incremental for safe retract)
G28 Z0. (return Z to home via intermediate)
G90
G53 X0. Y0. (optional park; only if safe on your machine)
M30
%
C) FANUC-STYLE 3-AXIS MILL — “TOOL-TO-TOOL” SAFE TRANSITION BLOCK
(— BETWEEN TOOLS: retract, stop coolant, safe Z, toolchange —)
M09
G53 Z0.
T[T##] M06
[WCS]
S[S####] M03
G43 H[H##] Z[SAFE_Z]
[COOLANT]
D) HAAS MILL — CRASH-PROOF SAFE START (NGC-FRIENDLY)
(HAAS safe start assumes G53 Z0 is safe; many shops use Z0 machine home)
%
O____ (PART / REV)
G90 G17 G20/G21 G40 G49 G80 G94
G103 P1 (limit look-ahead in start block if shop standard; optional)
G53 G00 Z0. (machine Z home)
(OPTIONAL park)
G53 G00 X0. Y0. (only if proven safe)
T[T##] M06
[WCS]
S[S####] M03
G43 H[H##] Z[SAFE_Z] M08
(M08 for flood; M88 for TSC if available)
M01
E) HAAS MILL — SAFE END
M09
G53 G00 Z0.
G53 G00 X0. Y0.
M30
%
F) FANUC-STYLE 4TH AXIS (INDEXING) — SAFE START ADD-ONS
(Use only if your 4th axis A is indexing, not simultaneous)
(Reset + safe Z first)
G90 G17 G40 G49 G80 G94
G53 Z0.
(Bring rotary to a known zero before setting WCS, if your process requires)
G00 A0. (or B0./C0. depending on machine)
[WCS]
T[T##] M06
S[S####] M03
G43 H[H##] Z[SAFE_Z]
M08
G) 5-AXIS NOTE (TCP/DWO) — SAFE STRUCTURE (CONCEPTUAL, CONTROL-SPECIFIC)
5-axis safety is machine-builder specific (Fanuc G43.4, Haas G234, Siemens TRAORI).
Use this pattern:
1) G53 Z safe
2) Set rotary to known orientation (A0 C0 or machine-specific)
3) Activate TCP/DWO AFTER tool length is known AND before cutting moves
4) Cancel TCP/DWO before tool change and before G53 moves, per builder rules
Example (Fanuc-style, conceptual):
G53 Z0.
T[T##] M06
[WCS]
S[S####] M03
G43 H[H##] Z[SAFE_Z]
(G43.4 / TCP on — if your machine uses it)
G43.4 H[H##]
M08
H) SIEMENS (GENERIC STRUCTURE) — SAFE START / SAFE END PATTERN
Siemens syntax varies by 840D solution line, machine builder, and shop templates.
Use this safe structure:
- Reset modes (plane, absolute, cycles, comp)
- Go to safe machine Z
- Tool call
- Work offset / frame
- Spindle/coolant
- Apply tool length compensation per Siemens tool management
Generic template (adjust to your builder’s standard):
(— SAFE START —)
; RESET MODES / CANCEL CYCLES / CANCEL COMP
; MOVE TO SAFE Z IN MACHINE COORDS
; TOOL CALL + SPINDLE ON
; ACTIVATE WORK OFFSET / FRAME
; APPROACH SAFE Z ABOVE PART
(— SAFE END —)
; COOLANT OFF
; RETRACT TO SAFE Z
; PARK
; END PROGRAM
I) “CRASH-PROOF” RAPID MOVE PATTERNS (THE ONES OPERATORS TRUST)
Pattern 1: Safe retract in WCS (only if clearance is guaranteed)
G00 Z[SAFE_Z]
G00 X[SAFE_X] Y[SAFE_Y]
Pattern 2: Safer: machine coordinate Z retract, then WCS XY
G53 Z0.
G00 X[SAFE_X] Y[SAFE_Y] (in WCS, only after Z is safe)
Pattern 3: Never rapid into negative Z unless proven:
BAD (common crash pattern):
G00 Z-100. (in WCS, this can drive into the part/fixture)
Better:
G00 Z[SAFE_Z]
G01 Z-100. F[PROVE_FEED] (ONLY if verified clearance and intended cut path)
J) PRINTABLE “START BLOCK CHECKLIST” (RUN BEFORE EVERY PROGRAM)
□ Units correct (G20/G21)
□ Plane correct (G17/G18/G19)
□ Absolute mode set (G90)
□ Feed mode set (G94 milling / G95 turning)
□ Cutter comp off (G40)
□ Length comp reset then applied correctly (G49 then G43 H…)
□ Canned cycles canceled (G80)
□ Rotation/scaling canceled unless intentionally used (G69/G50)
□ Coolant state explicit (M08/M09)
□ Spindle direction/speed explicit (M03/M04 + S…)
□ Safe Z retract path verified (G53 Z0 or proven safe Z in WCS)
□ Work offset verified ([WCS] correct)
□ First run with overrides low + single block + graphics verify
K) LATHE (FANUC-STYLE) — SAFE START / SAFE END (OD/ID TURNING)
(— LATHE SAFE START —)
%
O____ (LATHE PART / REV)
G18 G20/G21 G40 G80 G97 G99
(G18=XZ plane, G97=constant RPM, G99=feed per rev)
G28 U0. W0. (home X and Z via incremental; shop standard may differ)
T[T##][T##] (tool turret call format varies; e.g., T0101)
S[S####] M03
M08
[WCS or WORK SHIFT if used]
(Approach safe position)
G00 X[SAFE_X] Z[SAFE_Z]
(— LATHE SAFE END —)
M09
G28 U0. W0.
M30
%
L) MILL “END OF OPERATION” MINI-BLOCK (USE BETWEEN OPS, NOT PROGRAM END)
(— END OF OP / SAFE PARK FOR INSPECTION —)
M09
G00 Z[SAFE_Z]
G00 X[SAFE_X] Y[SAFE_Y]
M01
M) “CRASH-PROOF” TEMPLATE YOU CAN BUILD EVERYTHING ON (MILL)
(HEADER)
(SAFE START RESET)
(SAFE MACHINE Z)
(TOOL CHANGE)
(WCS + SPINDLE + LENGTH COMP + COOLANT)
(PROVE STOP OPTIONAL)
(— CUTTING OPERATIONS —)
(END OF OP SAFE PARK OPTIONAL)
(TOOL-TO-TOOL TRANSITION BLOCKS)
(PROGRAM END SAFE RESET)
N) QUICK NOTE ON WHY THIS LIBRARY PREVENTS CRASHES
It prevents the most common real crash triggers:
- Unknown modal state from a previous program/tool
- Rapid moves at low Z before retracting
- Accidental negative Z rapids (e.g., “G00 Z-100” in WCS)
- Mixed coordinate systems (G53 vs G54) without clear sequencing
- Tool length comp applied late or with wrong H
- Forgetting to cancel cycles/rotation before home/park moves
O) RECOMMENDED NEXT STEP (FOR YOUR SITE)
Create separate downloadable “one-pager” PDFs from each section:
- Fanuc Mill Safe Start/End
- Haas Mill Safe Start/End
- Lathe Safe Start/End
- Prove-Out Checklist
- Safe Rapid Patterns (G00/G53/G28) and “Do Not Do” examples
These printable assets are highly shareable and generate repeat visitors.
Leave a comment