Exercises & Assessment
Complete 20 basic questions, two code reviews, and two projects. This assessment tests how you explain coordinates, establish controller state, check geometry, and document a program before supervised verification. The examples use the stated Haas mill or lathe dialect, not interchangeable generic G-code.
- Answer twenty scoped questions
- Repair two deliberately flawed programs
- Score two projects against explicit criteria
Concept
Assessment combines a result with the assumptions that make it valid. A correct number with the wrong feed mode is not a complete answer.
Why It Matters
Separating interpretation, code review and project planning reveals whether an error concerns arithmetic, controller state or setup geometry.
How It Works
Attempt every item before opening its answer. State the controller, coordinate convention and required clearances. The scoring rules below award both the result and the explanation.
Example
For a metric diameter-mode lathe, reducing X50 to X48 removes (50−48)/2=1 mm radially. The subtraction and the diameter-mode assumption are separate parts of a complete answer.
Common Mistakes
Do not copy a mill startup into a lathe, count repeated drilling events as new positions, or infer a verified fixture clearance from a Z number alone.
Practice
Part 1 — Knowledge Check (Q01–Q12)
Unless a question explicitly says lathe, use a Haas mill, millimetres, no rotation or scaling, and the named work offset. Answers should state a relevant assumption, not infer missing machine conditions.
- Q01. What does G01 do, and how is it different from G00?
Answer
G01 commands a straight path at the programmed feed in the active feed mode. G00 is rapid positioning; its rate and path depend on the control and machine. F does not set its cutting feed. For a 30 mm straight cut at F300 mm/min, ideal feed time is 0.1 min; acceleration is excluded.
- Q02. What is G54?
Answer
G54 is the first work coordinate system offset (work zero). It shifts the coordinate origin from machine zero to the workpiece datum, so the programmer can use part coordinates instead of machine coordinates.
- Q03. On the selected mill, what is the difference between G90 and G91?
Answer
G90 = absolute programming: every coordinate is measured from the work zero. G91 = incremental programming: every coordinate is measured from the current tool position. G90 X50 means "go to X50"; G91 X50 means "move 50 mm in X."
- Q04. What does G41 do?
Answer
On the Haas mill, G41 places the compensated tool centre to the left of the programmed direction. D selects a compensation register; Setting 40 determines whether its entry is treated as radius or diameter. For motion along +X, left is +Y. The material side and lead-in must also be checked.
- Q05. In the stated diameter-mode lathe example, what does X40 mean?
Answer
In this assessment’s diameter-mode lathe examples, X40 means a diameter of 40 mm, so radial position is 20 mm from the axis. Changing X50 to X48 removes 1 mm radially. A radius-mode machine would need a different interpretation; confirm the configured mode.
- Q06. What does G80 do?
Answer
G80 cancels all canned drilling cycles. It stops the modal cycle mode; after G80, subsequent X/Y/Z motion is explicitly controlled by G00/G01 rather than by an active cycle. Note: G80 does not retract Z — write G00 Z50 explicitly. On Haas, a G00 or G01 motion also cancels the cycle, but writing G80 explicitly makes the intent clear.
- Q07. What is the difference between G98 and G99 in a drilling cycle?
Answer
G98 retracts to the initial Z plane (the height before the cycle was called). G99 retracts only to the R plane. Use G99 for holes with no obstructions between them; use G98 when there is a boss, clamp, or feature to clear.
- Q08. Why program G21 G17 G90 G40 G49 G80 at the start of a program?
Answer
These commands explicitly select metric units, the XY plane and absolute positioning, and cancel the named compensation and drilling modes on the mill. They do not establish every possible state. G94, G54, the tool, a new length call, spindle speed and actual clearance still require attention. Cancelling length compensation is not a machine-coordinate move.
- Q09. What is the difference between feed per minute (mm/min) and feed per revolution (mm/rev)?
Answer
mm/min is how far the tool travels each minute. mm/rev is how far the tool advances per spindle revolution. On the Haas lathe examples in this course, G98 selects feed per minute and G99 selects feed per revolution; on other controllers the code may differ — check the operator manual for the machine in front of you. The conversion is: mm/min = mm/rev × rpm. Example: 0.20 mm/rev at 1000 rpm = 200 mm/min.
- Q10. What does G43 H01 do?
Answer
G43 H01 applies the length compensation selected by H01. Tool length, the work offset and the programmed Z position jointly determine machine position. The example assumes a measured, correctly signed length value and a verified setup; H01 is a register selection, not evidence that the stored number is correct.
- Q11. What is the difference between climb (down) milling and conventional (up) milling?
Answer
In peripheral climb milling, chip thickness begins larger and decreases through the cut; conventional milling begins with a thin chip and increases. Backlash is a machine condition, not something conventional milling creates. Select the strategy using the machine condition and tooling guidance, rather than assuming every CNC machine has zero backlash.
- Q12. What is a work offset (fixture offset), and how many are commonly available?
Answer
G54 through G59 provide six standard work coordinate systems in the selected Haas examples. Further offsets depend on the control. In a simple unrotated XY setup, machine XY equals the selected origin XY plus programmed XY. Z must also be interpreted through the tool-length chain, not copied from that simplified XY equation.
Part 2 — Code Reading (Questions 13–16)
Q13. Read the following mill fragment. G21/G17/G90/G94/G54 are active, T01 is loaded, H01 is verified, and Z50 is clear. The tool is approved for the stated entry and the cutting region is free of clamps. What is the final programmed position?
G00 G43 H01 Z50.
S2000 M03
G00 X20. Y20.
G01 Z-2. F100.
G01 X80. F300.
G00 Z50.
G00 X0 Y0
M05Answer
H01 and Z50 are established before XY travel. The tool moves to (20,20), feeds to Z−2, cuts to X80 with Y20 unchanged, retracts to Z50, and returns to X0 Y0. Final programmed position is (0,0,50). F100 applies to the entry and F300 to the horizontal cut. This is a trace under stated conditions, not a complete setup procedure.
Q14. What does this subprogram call do? How many times does it run?
M98 P2000 L5
Answer (Haas)
P2000 calls subprogram O2000; L5 repeats it five times. If O2000 drills one hole at the current XY, this line calls O2000 five times at the same XY — repeat count alone does not create five different hole positions. The caller must reposition XY before each call to drill at different locations.
Q15. Read this lathe fragment in diameter mode with G21/G18/G40/G54/G97/G99 and the correct tool active. It illustrates coordinates only; the stock has been prepared for this light cut. What diameter is turned?
G00 X50. Z2.
G01 Z0 F0.2
X45.
Z-30.
X52.
Trace
Approach at X50 Z2. Feed to Z0. Step to X45 (now cutting Ø45). Turn along Z to Z−30 at Ø45. Step out to X52. The turned diameter is Ø45 over the length Z0 to Z−30.
Q16. After this line, what mode is the machine in?
G99 G83 R2. Z-15. Q3. F120.
Answer
Peck drilling cycle (G83) is active, modal. Retract mode is G99 (return to R2 after each hole). The cycle stays active until G80 or another documented cancelling motion command (such as G00/G01 on Haas). The next X/Y line will peck-drill at that position.
Part 3 — Find the Error (Questions 17–20)
Q17. This program has a bug. What happens?
G90 G54 G00 X0 Y0
G43 H01 Z50.
G01 Z-5. F100.
G01 X50.
G41 D05
G01 X80. Y30.
G00 Z50.
M30
Diagnosis
G41 is engaged at Z−5 while already inside material, without a lead-in move from outside the part. There is no G40 at the end to cancel compensation. There is also no startup block (G21, G17, G94, G80, G49). G41 must be engaged on a lead-in move from outside the stock, not mid-cut.
Q18. On a Haas, after the last hole at (50,50), this program uses G00 Z50. without writing G80. Does the machine continue drilling? How can the exit state be made clearer?
G90 G54 G00 X10. Y10.
G43 H01 Z50. M03 S1500
G81 R2. Z-15. F100.
X50. Y10.
X50. Y50.
G00 Z50.
M30
Diagnosis
On Haas, the G00 Z50 motion itself cancels the G81 cycle — the machine will not continue drilling. However, writing an explicit G80 before the Z retract makes the program's intent unambiguous and protects against controller differences. Best practice: add G80 before G00 Z50. This is a clarity issue, not a crash bug.
Q19. This turning program cuts the wrong diameter. Why?
G00 X30. Z2.
G01 Z0 F0.2
Z-30.
X40.
Diagnosis
The tool starts at X30 (Ø30 diameter) and turns along Z to Z−30 without changing X — it cuts a Ø30 shaft, not the intended Ø40. For a Ø40 target, the final axial cutting move must be at X40 in this diameter-mode example. Reaching that size from Ø50 stock requires a separately verified roughing and finishing plan; this fragment does not justify a single 5 mm radial cut.
Q20. Why is this tapping feed incorrect for the stated pitch? Assume the selected Haas mill uses G94, S500 is active, and a right-hand M10×1.5 tap is installed.
G84 R5. Z-15. F500.
(S500, M10x1.5 tap)
Diagnosis
The required feed is 1.5 mm/rev × 500 rev/min = 750 mm/min. F500 instead requests 1.0 mm per revolution under the stated mode. Correct the programmed relationship before running; the result of an incorrect command depends on the control and setup and must not be described as guaranteed thread stripping. Confirm the actual tapping-cycle requirements in the selected manual.
Part 4 — Code Reviews and Projects (CR1, CR2, P1, P2)
CR1 (10 points). The code below is supposed to drill one Ø8 hole at X30 Y20 to Z−12 in aluminum, S1500, F100. Assume the entry modes and spindle state are not established. Identify missing setup requirements and write a corrected complete example.
(SUBMITTED BY STUDENT)
G90 G54
G00 X30. Y20.
G81 R2. Z-12. F100.
M30
Defects and corrected code
Defects: missing G21/G17/G94/G40/G80 startup block; no documented tool-length establishment and verified clearance before the approach; spindle not started; no M08; the submitted code moves XY before the tool is at a verified Z clearance, so R2 has not been proven clear of the fixture; no explicit G80 after the cycle; no Z50 retract before M30. The R2 value itself is present — the defect is the unverified entry, not a missing parameter. Correct version (assumes T01 = Ø8 drill, H01 length entered, fixture clears Z50 and R2):
O0017
G21 G17 G90 G94 G40 G80 G49
G54
T01 M06 (O8 DRILL)
S1500 M03
G00 G43 H01 Z50. (tool length and clearance FIRST)
M08
G00 X30. Y20. (then move XY)
G99 G81 R2. Z-12. F100.
G80
G00 Z50.
M09
M05
M30
CR1 scoring (10 points): startup/units 2, tool length/order 3, spindle/coolant 1, cycle/exit 2, safety/clearance reasoning 2.
CR2 (10 points). The code below is supposed to rough-turn a raw Ø50 bar to Ø40 over Z−40 in mild steel. Use a maximum classroom roughing depth of 1 mm radially per pass. Identify defects and give a complete corrected program, including the finish pass.
(SUBMITTED BY STUDENT)
G00 X45. Z2.
G01 Z-40. F0.2
X50.
M30
Defects and corrected program
With Ø50 stock, the first X45 pass would remove (50−45)/2 = 2.5 mm radially and still leave 5 mm on diameter above the Ø40 target. The exercise permits at most 1 mm radial roughing depth per pass as a classroom constraint; this is not a universal insert limit. The fragment also fails to establish the tool, units, plane, work offset, spindle and feed mode, and does not reach the finished diameter. Use the five rough passes below and a separate finish pass. On the selected Haas lathe, G90 and G94 are turning cycles, not the mill’s absolute and feed-per-minute modes.
The following is one complete manual-pass solution. T0101 geometry and wear have been verified; the spindle direction suits the mounted tool. Diameter programming is enabled. The face begins at Z+1 and the facing insert can travel to X−1 at the verified centre height. The workholding and tool envelope must satisfy the clearance model below before this classroom example can be considered for a real setup.
| Pass | Diameter X | Radial depth | Length |
|---|---|---|---|
| Rough 1 | X48 | 1.0 mm | Z2 to Z−40 |
| Rough 2 | X46 | 1.0 mm | Z2 to Z−40 |
| Rough 3 | X44 | 1.0 mm | Z2 to Z−40 |
| Rough 4 | X42 | 1.0 mm | Z2 to Z−40 |
| Rough 5 | X40.4 | 0.8 mm | Z2 to Z−40 (finish stock) |
| Finish | X40.0 | 0.2 mm | S1200, F0.10 |
After each OD pass to Z−40: first retract radially to X52 (clear of the cut), then retract Z to Z2. Never move X and Z simultaneously in a G00 sweep across uncut material.
O0018
G21 G18 G40 G54 G97 G99
T0101 (OD tool, r0.4)
S1000 M03
M08
G00 X52. Z2.
(FACE - ESTABLISH Z0)
G01 Z0 F0.2
X-1.0 F0.15
G00 Z2.
G00 X52.
(ROUGH 1 - O48, 1.0mm radial)
G00 X48. Z2.
G01 Z-40. F0.2
G00 X52.
Z2.
(ROUGH 2 - O46)
G00 X46. Z2.
G01 Z-40.
G00 X52.
Z2.
(ROUGH 3 - O44)
G00 X44. Z2.
G01 Z-40.
G00 X52.
Z2.
(ROUGH 4 - O42)
G00 X42. Z2.
G01 Z-40.
G00 X52.
Z2.
(ROUGH 5 - O40.4, leave 0.4mm dia / 0.2mm radial)
G00 X40.4 Z2.
G01 Z-40.
G00 X52.
Z2.
(FINISH - O40.0)
S1200 M03
G00 X40.0 Z2.
G01 Z0 F0.1
Z-40.
G00 X52.
Z100.
M09
M05
M30
Note: the five manual OD passes above illustrate layered roughing. On a Haas lathe, G71 Type I would generate these passes automatically from the finished profile; the manual listing here is for teaching. Real depth-of-cut limits depend on insert grade, material hardness, machine rigidity, and chip evacuation.
Clearance model (classroom geometry): final face at Z0, original face at Z+1, chuck jaw front at Z−60, raw stock projection 61 mm. Toolholder extends 8 mm behind the tip, so at Z−40 the tool body reaches Z−48, leaving 12 mm axial clearance to the jaw. The X52 retract position must also clear the toolholder body radially outside the chuck and workholding. These values are teaching assumptions, not production recommendations. The initial move, radial withdrawal to X52, and final Z100 return are also assumed clear and within travel. This example finishes the front diameter only; it does not prescribe a production shoulder blend or parting operation.
CR2 scoring: identify the 2.5 mm first radial cut and remaining 5 mm diameter stock, 2 points; establish lathe modes/tool/spindle, 2; five rough targets and finish allowance, 2; consistent complete finish and withdrawal sequence, 2; explain the verified workholding envelope and entry, 2. Total 10.
P1 (20 points). Four Ø6 holes on a 40 mm square centered at (0,0), at (−20,−20), (20,−20), (20,20), (−20,20). Through holes in 6 mm plate: Z−8. S2000, F120. Write the program.
Use a prepared flat plate with G54 at its top centre, G17 and unrotated XY. T01 is a Ø6 drill with a classroom 118° point; H01 is measured. Z50 clears all positioning paths and R2 clears all four hole-to-hole paths. Support beneath each hole is absent through the verified drill-tip envelope; stock is secured outside that envelope. The programmed depth is the tip depth, not the full-diameter depth.
Worked solution
The point length is about 0.3004×6 = 1.80 mm. At Z−8 the full-diameter shoulder reaches about Z−6.20, 0.20 mm below the 6 mm plate. Confirm the actual drill geometry and backing clearance; this margin is a classroom value. Four cycle triggers occur: the G81 block at the first coordinate and three following XY blocks.
O0019
G21 G17 G90 G94 G40 G80
G54
T01 M06 (O6 DRILL)
S2000 M03
G00 G43 H01 Z50.
M08
G00 X-20. Y-20.
G99 G81 R2. Z-8. F120.
X20. Y-20.
X20. Y20.
X-20. Y20.
G80
G00 Z50.
M09
M05
M30P1 rubric: four signed coordinates, 4 points; drill-tip depth and backing clearance, 4; correct tool/length/feed/entry state, 4; exactly four cycle triggers and explicit exit, 4; inspection and setup verification plan, 4. Total 20. Check both diagonals (56.57 mm nominal), adjacent spacing (40 mm), hole size and full breakthrough using appropriate inspection methods; these nominal checks do not create a tolerance absent from a drawing.
P2 (20 points). Milling project: face mill a 60×40 mm rectangular block (X0–60, Y0–40) to Z−2, then drill two Ø5 holes at (15,20) and (45,20) to Z−10. Use Ø10 end mill (T01) and Ø5 drill (T02). S2000 F300 for mill, S1500 F100 for drill. Z0 is the unfinished top surface; after facing, the new top is Z−2.
For this classroom solution, the block occupies X0–60 and Y0–40; G54 Z0 stays on the original top throughout. T01 is approved for the stated side-entry facing cut, and H01/H02 are measured. The stock and holders clear X−6 and X66, all five rows and Z50 travel. The material extends below the specified drilling depth with verified backing clearance. All speeds and feeds are exercise inputs, not tooling recommendations.
Worked solution
O0020
G21 G17 G90 G94 G40 G80 G49
G54
T01 M06 (O10 END MILL)
S2000 M03
G00 G43 H01 Z50.
M08
(FACE: 5 PASSES TO COVER Y0-40, tool radius 5)
G00 X-6. Y4.
G01 Z-2. F100.
G01 X66. F300. (pass 1: covers Y[-1,9])
G00 Z50.
G00 X-6. Y12.
G01 Z-2. F100.
G01 X66. F300. (pass 2: covers Y[7,17])
G00 Z50.
G00 X-6. Y20.
G01 Z-2. F100.
G01 X66. F300. (pass 3: covers Y[15,25])
G00 Z50.
G00 X-6. Y28.
G01 Z-2. F100.
G01 X66. F300. (pass 4: covers Y[23,33])
G00 Z50.
G00 X-6. Y36.
G01 Z-2. F100.
G01 X66. F300. (pass 5: covers Y[31,41])
G00 Z50.
M09
M05
T02 M06 (O5 DRILL)
S1500 M03
G00 G43 H02 Z50.
M08
G00 X15. Y20.
G99 G81 R2. Z-10. F100.
X45. Y20.
G80
G00 Z50.
M09
M05
M30
The five rows cover Y intervals [−1,9], [7,17], [15,25], [23,33] and [31,41], so their union covers Y0–40. At X−6 the Ø10 cutter is entirely outside the left side before descending; each pass exits at X66. Z−10 remains measured from the original top, giving 8 mm tip depth below the newly faced Z−2 surface. Do not reset G54 Z between tools without recalculating the program. P2 rubric: datum and depth interpretation, 4 points; facing coverage and entry geometry, 4; both tools’ startup and H calls before XY, 4; two hole positions, cycle and exits, 4; fixture/holder and first-part inspection plan, 4. Total 20. Verify surface height, face coverage, both hole locations and depths; simulate the posted commands with the actual tool assemblies before supervised proving.
Use and Retake
Write your answers before opening the solutions. For each two-point question, award one point for the correct result or code meaning and one for its explanation, units and stated assumptions. Record which lesson addresses each missed concept. Before a retake, explain that concept in your own words and trace a fresh example with an instructor. Accept a different solution only when its geometry, controller assumptions and verification are equally sound.
This is a classroom assessment, not machine authorization. The examples do not cover five-axis kinematics, probing calibration or every machine alarm. Practical setup training and supervised verification remain necessary. Do not run deliberately flawed review code on a machine.
Grading
This assessment is worth 100 points, weighted by task type:
- 20 basic knowledge questions × 2 points = 40 points (Parts 1–3: recall, code reading, find-the-error).
- 2 code-review exercises × 10 points = 20 points (Part 4, CR1 and CR2: list every defect, then fix; partial credit per defect).
- 2 final projects × 20 points = 40 points (process plan + coordinates + program + verification; scored on completeness, safety, and geometry).
A passing score requires both (a) total score ≥ 80/100 and (b) every critical safety or geometry error (wrong work offset direction, missing tool-length call before Z-down, G41/G42 reversed into stock, unsafe retract) has been correctly identified and fixed. A score of 98 with an unfixed critical error does NOT pass; you must identify and fix all critical errors, then resubmit.
If you score below 80, identify which lesson the wrong answers cluster around and redo that lesson before retaking. Do not memorize answers; the point is to be able to read and debug code on a real machine.
Code-review exercises: for each, list every error you can find, then fix it. Projects: write the process plan, the coordinates, the program, and the verification steps. Submit them to a more experienced programmer for review before running them on a real machine.
Sources
- Haas lathe G-code table: G90/G94 turning cycles and G98/G99 feed modes.
- Haas mill programming: tool-length establishment and program structure.
- Haas mill G81: first-hole execution and following hole locations.
- Haas Automation, Mill Operator's Manual — G-code, M-code, and canned cycle reference.
- Haas Automation, Lathe Operator's Manual — G70/G71/G76 turning cycles and C-axis live tooling.
- Sandvik Coromant, Machining Engineering Knowledge Base — cutting parameters, chip geometry, tool life.