MECN 5004 A

Foam milling notes

Eight-petal rosette cut into a 100 × 100 × 30 mm foam block. Read the setup, then the pictures, then the program.

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

ItemValue
Stock100 mm in X, 100 mm in Y, 30 mm thick
Tool6 mm flat end mill
Work zeroFront-left corner, on the top face
AxesX to the right, Y to the back, Z up
Safe heightZ = 5 mm. All rapids across the block happen here.
SpindleM3, clockwise, 12 000 rpm
Plunge feedF180 (180 mm/min)
Cutting feedF900 (900 mm/min)
The assignment sheet only fixes the block size. The 6 mm cutter, the rpm, and the two feeds are choices for this job. Check them with the workshop before a real cut. Foam type, how the block is held, and the controller all change what “safe” means.

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.

FeatureFinal depthWhere
Rounded square frame3 mmTool path from 8 mm to 92 mm, corner radius 12 mm
East, north, west, south petals5 mm14 mm diameter pockets on a 27 mm pitch circle
Diagonal petals10 mmSame size, on the four corners of that circle
Centre ring7 mmTool-centre radius 12.5 mm, so the groove is 6 mm wide
Centre pocket12 mmSolid 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.

CheckResult
G21 (millimetres) and M30 (program end)Pass
Tool centre while cuttingX 8 to 92 mm, Y 8 to 92 mm
Cut edge, tool radius includedX 5 to 95 mm, Y 5 to 95 mm
Stays inside the 100 mm blockPass
Deepest Z−12.000 mm
Foam left under that cut18 mm
Does not cut throughPass
Arc radius error0 mm
Cutting path857.6 mm
Rapid path482.9 mm
Cutting time at F180 / F90093.7 s
Rapid time at 3000 mm/min9.7 s
Total cycle103.4 s
Volume removed19.53 cm³
Top view of the simulated milled surface
Top view of the finished surface. Colour is depth. 0 is the uncut top.
Isometric view of the 30 mm foam block
Isometric view of the 30 mm block. This is the part, not the toolpath.

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.

NC Viewer toolpath of the rosette
What you seeWhat it is
Blue linesCutting moves: G1, G2, G3. The rounded square, the circles, and the plunges.
Orange linesRapid moves, G0, at Z = 5 mm. The tool is in the air between features.
Red / green / blue axes at the cornerX, Y, and Z at the work zero.
Circles stacked on the same pocketThe 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 circleThe 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

LineMeaning
G21Millimetres.
G17Arcs in the XY plane.
G90Absolute coordinates, measured from zero.
G94Feed in mm/min.
G40 G49 G80Turn off cutter comp, tool-length offset, and any old drill cycle.
G54Use the work offset that you set on the front-left top corner.
G0 Z5Up to the safe height before any sideways move.
M3 S12000Spindle 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.

  1. Deep cuts are split into several passes instead of one plunge to the final depth.
  2. Every full circle is two 180° G3 arcs, because some controllers ignore a circle whose start and end are the same point.
FeaturePasses in the revised file
Frame, final −3 mmOne 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

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.