Lesson 10: Program Verification, Safe Start-Up and a Complete Part Program
Updated
A new CNC program is first checked by simulation and on the control graphics, then run in air with Z raised, in single block, with reduced rapid and feed overrides and a hand on Feed Hold. After the first part is measured, sizes are corrected with H and D wear offsets; the most common mistakes are a wrong H, missing G43, G91 left active, a missing decimal point and G80 or G40 not cancelled.
In this lesson you will learn:
- how to check a program before running it on the machine;
- how to make a safe first run: running in air, single block, reduced overrides;
- how to measure the first part and correct wear offsets;
- how to recognise the most common beginner mistakes;
- how to combine all parts of the course into one program for the training plate.
We use a Fanuc-style milling control (e.g. 0i-MF) and metric units; other controls differ, and the machine manual is always the authority.
Checks before the machine
- Simulation. Simulate CAM programs with real tool, holder and vise models, and make sure the post-processor matches your control (see CAM programming).
- Visual review. Do T, H and D numbers match; is there G43 after every tool change; G80 after cycles and G40 after a contour; is G90 restored after G91?
- Graphic check on the control. Many controls plot the tool path, often with the axes locked (machine lock) – afterwards the axis positions must be restored as the machine manual describes.
First run on the machine
- Check the G54 zero on the part, tool lengths H1–H4 and D1 = 5.000.
- Run the program in air: e.g. raise Z by 50 mm in the common (EXT) offset or G54 Z, and always restore it afterwards. The machine's Dry Run switch changes the feed rates, so use it only if you know how it behaves on your machine.
- Switch on Single Block – each block runs when Cycle Start is pressed.
- Set rapid override to 25 % or less, reduce feed override, keep your hand on Feed Hold, and before approaching the part compare the distance-to-go on screen with the real distance.
- During G84 tapping, overrides and Feed Hold usually do not act until the end of the cycle – make sure everything is right before it starts.
First-part measurement and offsets
| Dimension | Measured | Action |
|---|---|---|
| Profile 100.00 × 60.00 | 100.06 × 60.06 | D1 wear −0.03 (half the difference) |
| Pocket depth 6.00 | 5.95 | H1 wear −0.05 (with positive tool lengths) |
| Pocket width 20.00 | 19.96 | D offset has no effect because the centre path is programmed: check the cutter diameter or finish with G41 |
If the depths of all tools are wrong by the same amount, the G54 Z is more likely wrong than the tool lengths.
Common beginner mistakes
| Mistake | Consequence |
|---|---|
| Wrong H (e.g. T2 with H1) | Tool too high or digs into the part |
| Missing G43 | No length offset – usually a crash into the part or vise |
| G91 left active | Following coordinates measured from the current position |
| Wrong work offset (G55 instead of G54, or offset not set) | Whole program shifted |
| Missing decimal point | With default Fanuc settings X10 = 0.010 mm, not 10 mm |
| R vs I/J errors | Wrong arc sign or centre – arc in the wrong place or an alarm |
| Forgetting G80 or G40 | Next move drills a hole or shifts by the offset |
Alarm meanings are in Fanuc alarm codes, fault finding in CNC machine troubleshooting.
The complete part program
The blank is 102 × 62 × 20 mm EN AW-6082, held in a vise with at least 8 mm sticking out. G54 X0 Y0 is the lower-left corner of the finished 100 × 60 mm profile, Z0 the top. T1 machines the profile 5 mm deep with G41 D1 (D1 = 5.0) and the 40 × 20 × 6 mm pocket (tool centre path, subprogram from lesson 8), T2 spot drills, T3 drills and T4 taps four holes at X15 Y15, X85 Y15, X85 Y45, X15 Y45. Cutting data are example values; tool maker data takes priority.
O1000 (PLATE 100X60X20 EN AW-6082)
N10 G21 G17 G40 G49 G80 G90
(T1 - PROFILE 5 MM DEEP)
N20 T1 M06 (END MILL D10 3FL)
N30 G54 G00 X-10.0 Y-15.0 S6000 M03
N40 G43 H1 Z25.0 M08
N50 Z2.0
N60 G01 Z-5.0 F300
N70 G41 D1 X0 Y-5.0 F1200
N80 Y60.0
N90 X100.0
N100 Y0
N110 X-5.0
N120 G40 X-15.0 Y-15.0
N130 G00 Z25.0
(T1 - POCKET 40X20X6, CENTRE PATH)
N140 X35.0 Y30.0
N150 Z1.0
N160 G01 Z0 F300
N170 M98 P2001 L3 (OR P32001)
N180 G90 G00 Z25.0 M09
N190 M05
N200 G91 G28 Z0
N210 G90
(T2 - SPOT DRILLING)
N220 T2 M06 (SPOT DRILL D8 90)
N230 G54 G00 X15.0 Y15.0 S3000 M03
N240 G43 H2 Z25.0 M08
N250 G99 G81 X15.0 Y15.0 Z-3.5 R2.0 F300
N260 X85.0
N270 Y45.0
N280 G98 X15.0
N290 G80 M09
N300 M05
N310 G91 G28 Z0
N320 G90
(T3 - DRILLING D6.8)
N330 T3 M06 (DRILL D6.8)
N340 G54 G00 X15.0 Y15.0 S4000 M03
N350 G43 H3 Z25.0 M08
N360 G99 G83 X15.0 Y15.0 Z-18.0 R2.0 Q4.0 F500
N370 X85.0
N380 Y45.0
N390 G98 X15.0
N400 G80 M09
N410 M05
N420 G91 G28 Z0
N430 G90
(T4 - RIGID TAPPING M8X1.25)
N440 T4 M06 (TAP M8X1.25)
N450 G54 G00 X15.0 Y15.0
N460 G43 H4 Z25.0 M08
N470 M29 S500
N480 G99 G84 X15.0 Y15.0 Z-14.0 R5.0 F625
N490 X85.0
N500 Y45.0
N510 G98 X15.0
N520 G80 M09
N530 G91 G28 Z0
N540 G90
N550 M05
N560 M30
O2001 (POCKET STEP 2 MM)
N10 G91 G01 X30.0 Z-2.0 F300
N20 X-30.0 F1200
N30 Y-5.0
N40 X30.0
N50 Y10.0
N60 X-30.0
N70 Y-5.0
N80 G90
N90 M99
Profile: the cutter descends outside the blank, switches on G41 on the lead-in move to X0 Y-5 and travels clockwise around the part (climb milling); the lead-out to X-5 continues the bottom edge and G40 moves the cutter away. Spot drilling to Z-3.5 gives a chamfer of about Ø7 mm. G83 drills to Z-18 in 4 mm pecks. Tapping: F = S × pitch = 500 × 1.25 = 625 mm/min; Z-14 is about 2 mm above the bottom of the full-diameter hole (drill point ≈ 0.3 × D). More in drilling canned cycles, tap drill sizes and M-codes.
Exercise
Name three safety checks you will make before pressing Cycle Start for the first time with this program. The answer is in the FAQ.
This is the last lesson of the course. Go back to the course overview or read about CAM programming.
Frequently asked questions
Why can X10 mean 0.01 mm?
With default Fanuc settings a number without a decimal point is read in least input increments, i.e. micrometres. A parameter can change this, but it is safest always to write coordinates with a point, e.g. X10.0.
How can I check a program without cutting?
Simulate it in CAM, review the tool path in the control graphics and run the program in air with the Z offset raised, in single block and with reduced overrides.
What if the first part is out of tolerance?
Measure, find out which tool or zero is responsible and correct the wear offset (D for profiles with G41/G42, H for depth) rather than the program. Then repeat the finishing pass or run the next part.
Exercise answer
For example: 1) the G54 zero, tool lengths H1–H4 and D1 = 5.0 are checked and match the tools; 2) the blank is clamped firmly, sticks out of the vise more than 5 mm, and the first run is made in air or in single block; 3) rapid override is reduced, a hand is on Feed Hold, the doors are closed and the M98 format matches the control.
Looking for someone to do this job? Find a manufacturer on the marketplace or post a request.
Services offered I need a service