Learn VMC Programming: Outer Milling Using Radius By Manual Offset Method

 



INTRODUCTION:

Today, we are looking at a program designed to cut a 100mm x 100mm square with R20 rounded corners. We are using a Ø25mm End Mill. To make this program efficient, we aren't just cutting the shape once; we are using a Subprogram Loop. This allows us to cut deep into the material by taking multiple shallow passes, which protects the tool and ensures a smooth finish.


​Our machine doesn't know how big the tool is unless we tell it. Our drawing shows a 100 × 100 block with R20 corners. Our origin (X0, Y0) is the center of the block: The physical edges of the material are at 50mm and -50mm. However, because the tool has a diameter of 25 mm, if we program the machine to go to X50, the center of our 25mm tool will be at 50, meaning the edge of the tool will cut into our part by 12.5mm! It cannot stay on the 50 line or it will cut too much. You must add the tool's radius (12.5 mm) to the part's dimensions to find the Tool Center Path.

To cut exactly along the edge of a 50 mm boundary, the center of the tool must stay further out:

50(Part Edge) + 12.5(Tool Radius) = 62.5 mm

This gives us our maximum outer coordinates: X 62.5 and Y 62.5.

The tool path radius is R_{part} + R_{tool} = 20 + 12.5 = 32.5.

Now we will find tangent points i.e. start and end of arcs. This is where the 30 and -30 come from. A corner isn't just one point; it's a curve that starts on a straight line and ends on another. The corner radius on our drawing is R20. The curve starts 20 mm before the corner.

50 (Edge) - 20 (Radius) = 30

​So, for the top-left corner: The tool moves up the straight left edge at X-62.5. It needs to stop going straight and start turning when it hits the start of that R20 curve. That point is Y30. (Because 50 - 20 = 30).

In cnc, if G01 is for straight cut then G02 is for clockwise arcs. G01 Moves the tool in a straight line at a controlled cutting speed (Feedrate). G02: This is what creates the rounded corners.

G01 XY
XY : Horizontal coordinates or End points of line. Cutter will move in straight line till these points

G02 XYR
XY : They are destination coordinates. Coordinates for the arc’s endpoint. This tells the machine exactly where to stop.
R : for the radius of the arc.

e.g
G02 X50 Y25 R10 → Moves the tool clockwise along an arc of radius 10, ending at X=50, Y=25.

To get a smooth corner, we provide the X and Y destination and the R (Radius). Since we added our tool radius (12.5) to the part radius (20), our programmed radius is 32.5.



EXAMPLE:

O1234 ; (Main Program)
G90 G80 G40 G49 G54 G17 G21 ; (Safety block)
G28 G91 Z0.0 ; (Home Z)
G28 X0.0 Y0.0 ; (Home XY)
M06 T1 ; (Tool change to Tool 1)
G90 G54 X-62.5 Y0.0 ; (Move to start position outside part)
G43 H01 Z100.0 M03 S1000 ; (Tool length offset, Spindle ON)
G00 Z10.0 M08 ; (Rapid to clearance, Coolant ON)
G01 Z0.0 F500 ; (Move to surface)
M98 P1235 L20 ; (Call subprogram O1235, 20 times for 10mm depth)
G00 Z50.0 M09 ; (Retract tool, Coolant OFF)
G91 G28 Z0.0 ; (Home Z)
G28 X0.0 Y0.0 ; (Home XY)
M05 ; (Spindle OFF)
M30 ; (Program End)



O1235 ; (Subprogram)
G91 G01 Z-0.5 F500 ; (Incremental depth of cut)
G90 G01 X-62.5 Y30.0 F2000 ; (Move to start of top-left arc)

G02 X-30.0 Y62.5 R32.5 ; (Top-Left Arc)
G01 X30.0 ; (Straight top edge)

G02 X62.5 Y30.0 R32.5 ; (Top-Right Arc)
G01 Y-30.0 ; (Straight right edge)

G02 X30.0 Y-62.5 R32.5 ; (Bottom-Right Arc)
G01 X-30.0 ; (Straight bottom edge)

G02 X-62.5 Y-30.0 R32.5 ; (Bottom-Left Arc)
G01 Y0.0 ; (Return to lead-in point)

M99 ; (Return to Main)


EXPLAINATION:

​Program (o1234):

• ​G90 G80 G40 G49 G21 G17 G15: This is a Safety Block. It ensures the machine isn't "remembering" any old settings like canned cycles (G80) or tool offsets (G40/G49) that could cause a crash.

• ​G28 G91 Z0.0: This sends the spindle to the Home Position in the Z-axis. Using G91 (Incremental) with Z0.0 ensures it moves directly to home without traveling through your workpiece.

• ​M06 T1: Tool Change. The machine stops, moves the carousel, and loads Tool 1.

• ​G43 H01 Z100.0: This activates Tool Length Compensation. It tells the machine: "Look at the length of Tool 1 (stored in H01) and stop the tip 100mm above the part."

• ​M98 P1235 L20: This is the "Brain" of the operation.

• ​M98: Call Subprogram.

• ​P1235: Go find program O1235.

• ​L20: Run it 20 times. Since each pass in O1235 drops the tool by 0.5 mm, the total depth will be 10 mm.



Subprogram (o1235):

​This defines the actual "Loop" the tool travels.

• ​G91 Z-0.5: This is the only line using Incremental mode. Instead of going to a specific floor, it tells the tool: "Go down 0.5mm from where you are right now." Because the Main Program calls this subprogram 20 times (L20), the tool slowly steps down like a spiral until it reaches a total depth of 10mm.

• ​G90 G01 X-62.5 Y30.0: Switches back to Absolute mode. The tool moves to the start of the first corner. Note that 30.0 is the "tangent point" where the straight edge ends and the curve begins (50 - 20 = 30).

• ​G02 X-30.0 Y62.5 R32.5: Circular Interpolation (Clockwise).

• ​The tool swings from the left side to the top side. Tool swings around the top-left corner. The center of this arc is calculated based on the R32.5 we found earlier.

• Tool moves across the top. It continues until it returns to the start point, then the subprogram ends, and the next loop begins.

• ​M99: Subprogram End. Instead of ending the whole job, this tells the computer to jump back to the Main Program. If the L count isn't finished, it starts the loop again.





Post a Comment

0 Comments