Learn VMC Programming: Outer Milling Using i, j, k By Manual Offset Method

 





INTRODUCTION:

In this program, we want a final part that is 100mm wide. However, we are using a 20mm diameter tool. Since we are not using G41/G42, we must calculate the Tool Center Path. If we tell the machine to go to X50, the center of the tool goes to X50, and our tool will cut 10mm deep into our finished part.

​To get a finished part that is 100 × 100 with R25 corners using a diameter of 20 mm cutter (10 mm radius), we have to offset the tool path outwards by the tool radius i.e. 10 mm.

Total Width/Height: 100 + 10 + 10 = 120 mm.
Corner Radius of Path: 25 + 10 = 35 mm.
The flat sections stay the same (50 mm) because we added the radius to both ends.

​Think of the Main Program (O1235) as the Manager. It handles the safety, starts the spindle, and decides how deep we are going. Think of the Sub-Program (O1236) as the Machinist. It only knows one thing: how to walk around the shape of the part once. By using the L10 command, the Boss tells the Worker to do that same lap 10 times, going 0.5mm deeper each time.

​While R is easy, I and J are the professional way to program. I is the X-distance from where the tool is to where the center of the circle is. J is the Y-distance from where the tool is to where the center of the circle is.



EXAMPLE:

O1235 (MAIN PROGRAM)
N1 G21 G17 G40 G49 G80 G90 ;
G91 G28 Z0.0 ; (Home Z axis)
G91 G28 X0.0 Y0.0 ; (Home XY axis)
M06 T1 ;
G90 G54 G00 X60.0 Y0.0 ; (Move to start position in Absolute)

G43 H01 Z10.0 M03 S1000 ; (Apply height offset, coolant on, spindle start)

G01 Z0.0 F500 ; (Move to workpiece surface)
M98 P1236 L10 ; (Call sub-program O1236 ten times)
G00 Z10.0 M09 ; (Retract and coolant off)
G91 G28 Z0.0 ; (Home Z)
G28 X0.0 Y0.0 ; (Home XY)
M05 ; (Spindle stop)
M30 ; (End of program)



O1236 (SUB - I J CALCULATED)
G91 G01 Z-0.5 F100 ;
G90 G01 X60.0 Y25.0 F500 ; (Start point on right edge)

(--- TOP RIGHT ARC ---)
G03 X25.0 Y60.0 I-35.0 J0.0 ; (Center is 35mm left of start)

G01 X-25.0 ; (Top flat edge)

(--- TOP LEFT ARC ---)
G03 X-60.0 Y25.0 I0.0 J-35.0 ; (Center is 35mm below start)

G01 Y-25.0 ; (Left flat edge)

(--- BOTTOM LEFT ARC ---)
G03 X-25.0 Y-60.0 I35.0 J0.0 ; (Center is 35mm right of start)

G01 X25.0 ; (Bottom flat edge)

(--- BOTTOM RIGHT ARC ---)
G03 X60.0 Y-25.0 I0.0 J35.0 ; (Center is 35mm above start)

G01 Y0.0 ; (Return to side midpoint)
M99 ;



EXPLAINATION:


X25/Y25: These are the tangency points. Since the path radius is 35 and the total distance is 60, the flat section starts at 60 - 35 = 25.


Main Program (O1235):


​This section prepares the machine and handles the depth.

• ​O1235: The program number.

• ​G21: Sets units to Metric (millimeters).

• ​G17: Selects the XY Plane for circular interpolation.

• ​G40 / G49 / G80: Safety codes. They cancel previous tool compensation, tool length offsets, and canned cycles to start "fresh."

• ​G90: Absolute Positioning. All coordinates are measured from the Work Home (G54 X0 Y0).

• ​G91 G28 Z0.0: Sends the Z-axis to the machine's home position (safety retract).

• ​M06 T1: Tool Change to Tool #1 (your 20mm Endmill).

• ​G54: Selects Work Coordinate System 1 (where you touched off your part).

• ​G00 X60.0 Y0.0: Rapid move to the start position. (Note: X60 is 50mm part half-width + 10mm tool radius).

• ​G43 H01 Z10.0: Activates Tool Length Compensation for Tool 1 and moves to a 10mm safety height.

• ​M03 S1200: Starts the spindle Clockwise at 1200 RPM.

• ​M98 P1236 L10: Sub-program Call.

• ​P1236 is the sub-program name.

• ​L10 tells the machine to repeat the sub-program 10 times.

• ​M30: End of Main Program and reset.


Sub-Program (O1236):


​This section defines the tool path for one single layer.

• ​G91 G01 Z-0.5 F100:

• ​G91 (Incremental) makes the tool go down 0.5mm from its current position.

• ​F100 is a slow feed rate for entering the material.

• ​G90 G01 X60.0 Y25.0 F500: Switches back to Absolute mode and moves to the start of the first corner.

• ​G03 X25.0 Y60.0 I-35.0 J0.0: Counter-Clockwise Arc.

• ​X25 Y60 is the end point of the arc.

• ​I-35.0 is the distance from the Start Point (X60) to the Center of the arc (X25). Since the center is 35mm to the left, it is negative.

• ​G01 X-25.0: Linear move (straight line) across the top of the part.

• ​G03 X-60.0 Y25.0 I0.0 J-35.0: The second corner arc.

• ​J-35.0 tells the machine the center is 35mm down from the current Y60 position.

• ​G01 Y-25.0: Straight line down the left side.

• ​G03 X-25.0 Y-60.0 I35.0 J0.0: The third corner arc.

• ​I35.0 means the center is 35mm to the right.

• ​G01 X25.0: Straight line across the bottom.

• ​G03 X60.0 Y-25.0 I0.0 J35.0: The final corner arc.

• ​J35.0 means the center is 35mm up.

• ​G01 Y0.0: Closes the loop by returning to the side midpoint.

• ​M99: Sub-program End. This sends the control back to the Main Program to repeat the loop or finish.




I, J, K Explained:

In VMC (Vertical Machining Center) programming, I, J, and K are used to define the center point of an arc or circle during circular interpolation. G02/G03 tells the machine where the arc ends, but I, J, and K tell the machine what the arc swings around. In very simple terms, I, J, and K are like a GPS for the center of a circle.


What do they indicates?

​These are "incremental" distances from the Start Point of the arc to the Center Point of the arc. They correspond to the three main axes:

I: Distance along the X-axis.
J: Distance along the Y-axis.
K: Distance along the Z-axis (used for helical milling or 3D arcs).


​Why do we need them instead of R?

We can also program arcs using R like G02 X50.0 Y50.0 R25.0. However, I and J are preferred in professional machining for two main reasons:

• You cannot program a 360° circle with an R command because the machine doesn't know where the center is (it could be anywhere). To mill a full hole or boss, you must use I, J, or K. For a full circle, you don't even need X and Y because the end point is the same as the start.

• If your start point and end point are slightly off mathematically, an R command might still execute but create a slightly "flat" arc. With I and J, if the math doesn't "close" perfectly, the Fanuc controller will throw an alarm. This prevents you from cutting an inaccurate part.


How to find the value?

​The most important rule to remember: I and J are measured from the Start Point to the Center Point. Always measure from where the tool is currently standing to where the center of the circle is.

• I = The distance to the center in the X direction.

• J = The distance to the center in the Y direction.

I and J are incremental means they are a distance, not a coordinate, the machine only cares about which way it has to look to find the center. Instead of looking at where the tool is relative to the center, stand on the tool and look toward the center:

1. For I (Left/Right):

If the center is to the Right of your tool then Positive (+I)
If the center is to the Left of your tool then Negative (-I)

2. For J (Up/Down):

If the center is Above (Up) your tool then Positive (+J)
If the center is Below (Down) your tool then Negative (-J)

Imagine you are at the "6 o'clock" position of a circle and you want to mill it.

• To find the center of the circle, you have to look UP.
• Up is the positive Y direction.
• Therefore, your J value is Positive. (Since you don't need to move left or right to see the center, I is 0).


e.g.
1. If your tool is at X0, Y0 and you want to cut a full circle with a 50mm radius. The center of that circle is 50mm to the right.

• It means tool is left to center then it is negative value.
• From your tool (0) to the center (50) is +50 in X.
• Since the center isn't higher or lower than the tool, the Y distance is 0.

The Code: G02 I50.0 J0.0


2. Cutting a 90° Arc:

​Imagine your tool is currently at X0, Y0 i.e. start point and you want to swing a 10mm radius arc clockwise to X10, Y10 I.e. end point.

To swing from (0,0) to (10,10) clockwise, the center must be at X10, Y0.

Calculate I and J:

From Start X(0) to Center X(10) is +10.0. So, I10.0

From Start Y(0) to Center Y(0) is 0. So, J0.

​G02 X10.0 Y10.0 I10.0 J0.0


When to use each?

I and J used in the G17 plane (X-Y plane). This is 99% of what you will do on a VMC for pocketing and profiling. I and K used in the G18 plane (X-Z plane). J and K used in the G19 plane (Y-Z plane).

On a Fanuc controller, if you get the plus/minus sign wrong, the machine won't just "try its best"—it will usually alarm out with an "Illegal Arc" or "Arc Radius Difference" error.

​This happens because if you give the wrong sign, the machine thinks the center is on the wrong side of the tool, making it impossible to reach the "End Point" you programmed.

Post a Comment

0 Comments