This printable library gives you proven, “crash-resistant” CNC start and end blocks you can paste into programs to reduce the most common causes of crashes: wrong modal states, wrong plane, wrong units, active comp, unexpected work offsets, and unsafe retract paths. These templates are intentionally conservative. Always verify your control’s exact options (especially 5-axis, TCP, and probing), and simulate/dry-run with the door open and feed override low on first use.
============================================================
A) UNIVERSAL SAFETY RULES (PRINT THIS)
1) Always reset dangerous modals at the start: plane, units, absolute/incremental, cutter comp, tool length comp, canned cycles, coordinate rotation, scaling, smoothing modes.
2) Retract Z first, then move X/Y (milling) or retract X first, then Z (turning), unless your machine builder specifies otherwise.
3) Use machine-coordinate retracts (G53) or a proven reference return (G28/G30) ONLY if you fully understand how your control executes the intermediate point.
4) Cancel canned cycles (G80), comp (G40/G49), rotation (G69), scaling (G50.1 on some controls), and advanced smoothing/TCP modes before tool change and before program end.
5) Never assume the last program left the machine “clean.” Always start clean.
============================================================
B) MILLING — FANUC-STYLE “SAFE START” (3-AXIS)
(Use this at the top of each tool section or at program start.)
%
O0001 (PART NAME / REV / MATERIAL)
(SETUP: G54, TOOL LIST, FIXTURE CLEARANCES VERIFIED)
(—- SAFE START / MODAL RESET —-)
G90 G17 G21 (ABS, XY plane, metric — use G20 for inch)
G40 G49 G80 (Cancel cutter comp, tool length comp, canned cycles)
G54 (Select expected work offset)
G94 (Feed per minute)
G99 (Return to R-plane for drilling cycles; use G98 if needed)
(OPTIONAL: Cancel rotation / scaling / smoothing if your control supports)
G69 (Cancel coordinate rotation if used previously)
(OPTIONAL) G05.1 Q0 (Cancel AI contour control if your machine uses it)
(OPTIONAL) G08 P0 (Cancel smoothing mode if used)
(OPTIONAL) G61 (Cancel exact stop if previously enabled, returns to default on many controls)
(—- TOOL CALL / SPINDLE / COOLANT —-)
T01 M06
G00 G43 H01 Z100.0 (Apply tool length comp safely ABOVE part; adjust Z safe height)
S12000 M03 (Spindle CW)
M08 (Coolant ON)
(—- APPROACH SAFE POSITION —-)
G00 X0.0 Y0.0 (Move above start position at safe Z)
(READY FOR CUTTING MOVES)
C) MILLING — HAAS “SAFE START” (NGC FRIENDLY)
%
O0001 (PART / REV)
(—- SAFE START —-)
G90 G17 G20 (Use G21 for metric)
G40 G49 G80 (Cancel comp/cycles)
G54 (Expected WCS)
G94 (Feed/min)
G98 (Return to initial plane for drilling; choose per job)
G187 P2 E0.010 (Medium tolerance mode as a safe default; change as needed)
(OPTIONAL) G69 (Cancel rotation)
T1 M06
S10000 M03
G00 G43 H1 Z4.0
M08
G00 X0. Y0.
============================================================
D) MILLING — SIEMENS “SAFE START” CONCEPT (STRUCTURE)
Siemens syntax varies by series and shop standard, but your safe start should always:
- Set units (MM/INCH), plane, absolute mode
- Cancel tool radius comp, tool length comp, cycles, transformations
- Call the correct work offset / frame
- Move to a verified safe clearance position before XY moves
Example skeleton (adapt to your control):
(UNITS/PLANE/ABS)
(CANCEL CYCLES/COMP/TRANSFORMS)
(SELECT WORK OFFSET / FRAME)
(TOOL CALL)
(SPINDLE/COOLANT)
(SAFE Z UP, THEN XY)
============================================================
E) TURNING — FANUC “SAFE START” (2-AXIS LATHE)
%
O0100 (LATHE PART / REV)
(—- SAFE START / MODAL RESET —-)
G18 G40 G80 (XZ plane, cancel cutter comp, cancel cycles)
G99 (Feed per rev for turning; use G98 feed/min if required)
G50 S3500 (Max spindle speed limit — CRITICAL with G96 CSS)
G54 (Work offset)
(OPTIONAL) G97 (Fixed RPM mode at start; switch to G96 if desired)
(—- TOOL / SPINDLE / COOLANT —-)
T0101 (Tool 1, offset 1)
G97 S1200 M03 (Fixed RPM CW)
M08
(—- SAFE APPROACH —-)
G00 X100.0 Z100.0 (Safe clearance position — adjust to your machine/part)
(READY FOR CUTTING MOVES)
============================================================
F) “CRASH-PROOF” START BLOCK FOR EACH TOOL (MILLING)
Use this at the start of EACH tool to prevent leftover modals from previous tools:
(—- TOOL SAFE RE-INIT —-)
G90 G17 G21
G40 G49 G80
G54
G94
G69
(OPTIONAL) G05.1 Q0
(OPTIONAL) G08 P0
T## M06
G00 G43 H## Z100.0
S#### M03
M08
G00 X… Y…
============================================================
G) END BLOCK — MILLING (FANUC/HAAS STYLE)
Use this at the end of the program to leave the machine in a predictable, safe state:
(—- SAFE END / RETURN —-)
G40 G49 G80 (Cancel comp/cycles)
G69 (Cancel rotation)
(OPTIONAL) G05.1 Q0 (Cancel smoothing)
(OPTIONAL) G08 P0
M09 (Coolant OFF)
G00 Z100.0 (Retract to safe Z in current WCS)
(Preferred: Machine-coordinate retract if your shop standard uses it)
G53 Z0. (Machine Z home — only if verified safe on your machine)
G53 X0. Y0. (Machine XY home — only if verified safe)
M05 (Spindle stop)
M30 (End / rewind)
============================================================
H) END BLOCK — LATHE (FANUC STYLE)
(—- SAFE END —-)
G40 G80
M09
G00 X200.0 Z200.0 (Safe retract position)
M05
M30
============================================================
I) “SAFE RAPID” PATTERNS (COMMON CRASH PREVENTION)
1) Milling safest reposition (Z first):
G00 Z100.0
G00 X… Y…
2) Lathe safest reposition (X first, then Z):
G00 X200.0
G00 Z200.0
3) Before tool change (milling):
G40 G49 G80
G00 Z100.0
M09
T## M06
============================================================
J) QUICK CHECKLIST BEFORE FIRST RUN
- Correct WCS selected (G54/G55/…) and verified with a known reference
- Correct tool length offset H and diameter/wear offsets D loaded
- Safe Z clearance value is truly safe for your fixture and part height
- Spindle direction correct (M03/M04)
- Coolant mode correct (M08/M07/TSC M88 if applicable)
- Simulation and single-block tested for first tool
============================================================
K) NOTES FOR ADVANCED/5-AXIS USERS
If you use TCP / kinematic transformations (Fanuc G43.4, Haas G234, Siemens TRAORI, etc.), add explicit cancel lines before tool change and end block per your control’s manual. A safe default pattern is:
- Cancel TCP/transform
- Cancel rotation/tilted plane
- Retract Z
- Then move XY / rotary axes to safe park positions
Use these templates as a base and standardize them site-wide so every program “starts clean” and “ends clean.”
Leave a comment