The job
Each student writes a G-code pattern that will be cut into foam, 10 cm by 10 cm by 3 cm thick. Hand in the G-code as a text file, a top view, and an isometric view. The best pattern is the one they mill in the workshop.
This pattern is a rounded square frame, eight round pockets, a ring, and a deep centre hole. The file to run first in a viewer is Milling_Project_GCode.txt.
Setup before you press start
| Item | Value |
|---|---|
| Stock | 100 mm in X, 100 mm in Y, 30 mm thick |
| Tool | 6 mm flat end mill |
| Work zero | Front-left corner, on the top face |
| Axes | X to the right, Y to the back, Z up |
| Safe height | Z = 5 mm. All rapids across the block happen here. |
| Spindle | M3, clockwise, 12 000 rpm |
| Plunge feed | F180 (180 mm/min) |
| Cutting feed | F900 (900 mm/min) |
What gets cut
Click a name. The matching shape lights up.
Frame. Tool centre runs 8 mm in from the edges, with 12 mm corner arcs. The 6 mm cutter leaves about 5 mm of foam around the outside. Depth 3 mm, one pass.
| Feature | Final depth | Where |
|---|---|---|
| Rounded square frame | 3 mm | Tool path from 8 mm to 92 mm, corner radius 12 mm |
| East, north, west, south petals | 5 mm | 14 mm diameter pockets on a 27 mm pitch circle |
| Diagonal petals | 10 mm | Same size, on the four corners of that circle |
| Centre ring | 7 mm | Tool-centre radius 12.5 mm, so the groove is 6 mm wide |
| Centre pocket | 12 mm | Solid disk out to 5.5 mm radius. Deepest cut. 18 mm of foam remains. |
Simulator results
These numbers come from running the original program as a 6 mm flat end mill on a 0.25 mm grid. Work zero is the front-left top corner.
| Check | Result |
|---|---|
| G21 (millimetres) and M30 (program end) | Pass |
| Tool centre while cutting | X 8 to 92 mm, Y 8 to 92 mm |
| Cut edge, tool radius included | X 5 to 95 mm, Y 5 to 95 mm |
| Stays inside the 100 mm block | Pass |
| Deepest Z | −12.000 mm |
| Foam left under that cut | 18 mm |
| Does not cut through | Pass |
| Arc radius error | 0 mm |
| Cutting path | 857.6 mm |
| Rapid path | 482.9 mm |
| Cutting time at F180 / F900 | 93.7 s |
| Rapid time at 3000 mm/min | 9.7 s |
| Total cycle | 103.4 s |
| Volume removed | 19.53 cm³ |
Use these two pictures for the top view and the isometric view in the submission. They show the foam after cutting, with the real depths.
3D model
You do not need AutoCAD for this. The block below is the milled foam: 100 × 100 × 30 mm, bottom on Z = 0, top face at Z = 30. Drag to turn it. Scroll to zoom.
The file rosette-foam.stl is the same solid. Windows 3D Viewer opens it. AutoCAD, Fusion 360, and FreeCAD open it too if you already have one of them.
Drag = rotate. Wheel = zoom. The deep centre pocket is the dark hole in the middle.
NC Viewer
This is the toolpath from NC Viewer for the revised file, the one with several depth passes. It is a picture of the cutter moving, not a picture of the finished foam.
| What you see | What it is |
|---|---|
| Blue lines | Cutting moves: G1, G2, G3. The rounded square, the circles, and the plunges. |
| Orange lines | Rapid moves, G0, at Z = 5 mm. The tool is in the air between features. |
| Red / green / blue axes at the corner | X, Y, and Z at the work zero. |
| Circles stacked on the same pocket | The same pocket cut again at a deeper Z. Shallow petals have 2 passes. Deep petals have 3. The ring has 2. The centre pocket has 3. On the foam they become one hole at the final depth. |
| Short lines inside each circle | The tool stepping from the 4 mm orbit to the 1.5 mm orbit, then to the pocket centre, so the 6 mm cutter clears a solid disk. |
From this view: the frame closes, the eight pockets sit evenly on the circle, the ring and the centre pocket share the middle of the block, and the path stays inside the 100 mm square.
How to read the original program
Open Milling_Project_GCode.txt. Anything in brackets is a comment. The machine skips it. A code stays on until another line changes it. On an arc, I and J measure from the start of that arc to the centre of the arc.
Startup
| Line | Meaning |
|---|---|
G21 | Millimetres. |
G17 | Arcs in the XY plane. |
G90 | Absolute coordinates, measured from zero. |
G94 | Feed in mm/min. |
G40 G49 G80 | Turn off cutter comp, tool-length offset, and any old drill cycle. |
G54 | Use the work offset that you set on the front-left top corner. |
G0 Z5 | Up to the safe height before any sideways move. |
M3 S12000 | Spindle on, clockwise. |
One pocket, east petal
G0 X81.000 Y50.000 G1 Z-5.000 F180 G3 X81.000 Y50.000 I-4.000 J0.000 F900 G1 X78.500 Y50.000 G3 X78.500 Y50.000 I-1.500 J0.000 G1 X77.000 Y50.000 G0 Z5.000
The pocket centre is (77, 50). The first rapid parks 4 mm to the right of that centre, still at Z5. The plunge goes straight down. The first G3 is a full circle: start and end are the same point, and I−4 puts the centre 4 mm to the left. The move to X78.5 is the smaller orbit. The last G1 sits on the pocket centre. Then the tool lifts before it travels to the next pocket.
The other seven pockets use the same seven moves. Only the centre point and the depth change. Cardinal pockets stop at −5 mm. Diagonal pockets stop at −10 mm.
Frame corners
The frame is a square with quarter-circles. G3 X92 Y20 I0 J12 starts at (80, 8). The centre is 12 mm above that start, at (80, 20), and the end is (92, 20). G3 is counter-clockwise. With a clockwise spindle that is the climb direction.
End
M5 stops the spindle. G0 X0 Y0 returns to the corner at the safe height. M30 ends the program.
AI reference
This section is a review written by ChatGPT of a second file. It is marked so you can tell it apart from the notes above. The file is MECN5004A_Milling_Project_SAFE.gcode.
ChatGPT kept the same 100 × 100 × 30 mm shape, the same 6 mm cutter, the same safe Z, the same work zero, and the same final depths. It changed two things in the motion.
- Deep cuts are split into several passes instead of one plunge to the final depth.
- Every full circle is two 180° G3 arcs, because some controllers ignore a circle whose start and end are the same point.
| Feature | Passes in the revised file |
|---|---|
| Frame, final −3 mm | One pass. It is already shallow. |
| 5 mm petals | −2.5 mm, then −5 mm |
| 10 mm petals | −3.5 mm, then −7 mm, then −10 mm |
| Centre ring, final −7 mm | −3.5 mm, then −7 mm |
| Centre pocket, final −12 mm | −4 mm, then −8 mm, then −12 mm |
What ChatGPT said about the NC Viewer picture
- The stacked blue circles are the same pocket at more than one Z. They are not extra grooves.
- Orange is the rapid at the safe height, not a cut through the foam.
- The frame closes, the eight pockets are even, the ring and the centre pocket are in the middle, and the path stays in the 100 mm square.
- Do not hand in the NC Viewer picture as the isometric view. It shows motion. The isometric should show the block and the finished depths.
- Nobody can call the code safe for a real machine until the workshop confirms the controller, the cutter, the rpm, the feeds, the clamp, and the foam.
Half-circle example from the revised file
G3 X73.000 Y50.000 I-4.000 J0.000 G3 X81.000 Y50.000 I4.000 J0.000
First arc: from (81, 50) to (73, 50), centre 4 mm to the left. That is the left half. Second arc: from (73, 50) back to (81, 50), centre 4 mm to the right. I changes sign because the start point has moved to the other side of the same centre. Together they are one full circle.