Resources and Software For High-Performance CNC Machinists

In Stores
Categories
Subscribe to Blog

In this tutorial we are going to explore different options and techniques when programming cutter movement.

Lets begin with a simple part shown in a drawing below.

Basically it is a rectangular piece 4.00x2.00
For the purpose of simplicity lets make the depth of our profile (z- dimention) 0.75"

We are going to use a 0.5" dia endmill, again because it is a very common size and is easy to do basic math with.

I took a liberty of puting locations for our part/toolpath, so it is easy to extract numbers from the drawing just by looking at it.

Notice the green rectangle. This rectangle represents the path that the center of the tool will have to take to produce the part with required dimentions.
The thing is: because endmills have certain diameter, the center of the tool must be always offset by its radius.

There are two ways of doing that.

### First option is to program to the center of the tool.

In this case all coordinates must be offset manually. This is usually done by a CAD/CAM system, since it is fairly easy for computer to offset the center of the tool.

Out G-Code would look like this:

Code
T5M6 (0.5" 4 FLUTE ENDMILL)
G90 G54 G0 X-0.75 Y-0.75 S5000 M3 (MOVE TO THE START POSITION OUTSIDE THE PROFILE, TURN ON THE SPINDLE)
G0 G43 H05 Z2.0 M08 (APPLY CUTTER LENGTH OFFSET, MOVE TO 2" ABOVE THE PART, TURN ON THE COOLANT)
G0 Z0.1 (RAPID TO THE FEED PLANE HEIGHT)

G1 Z-0.75 F10.0 (PLUNGE TO THE START POINT OUTSIDE THE PROFILE)
G1 X-0.25 Y-0.25 F50.0 (LEAD IN TO THE LOWER LEFT CORNER)
G1 Y2.25 (MILL WALL 1)
G1 X4.25 (MILL WALL 2)
G1 Y-0.25 (MILL WALL 3)
G1 X-0.25 (MILL WALL 4)
G0 Z1.0 M09 (RAPID OUT TO CLEARANCE HEIGHT, TURN OFF THE COOLANT)

G0 G28 G91 Z0 M5 (RAPID TO THE TOOL CHANGE HEIGHT, TURN OFF THE SPINDLE)
M30 (END)

As you can see we had to manually add a 0.25" offset to al of our programmed points.
This may look somewhat easy when doing a simple rectangle, but becomes hard and next to impossible when programming complex profiles.
This is called "programming to the tool centre" This programming style is almost exclusive to CAM programs.

### The second option

is to program to the finished profile and tell the CNC machine to offset the toolpath by the radius of the cutter.
In that case we have to first apply cutter compensation, and then simply key in our part coordinates to get the proper result - machine handles cutter radius compensation on its own.

Here is how it looks:

Code
T5M6 (0.5" 4 FLUTE ENDMILL)
G90 G54 G0 X-0.75 Y-0.75 S5000 M3 (MOVE TO THE START POSITION OUTSIDE THE PROFILE, TURN ON THE SPINDLE)
G0 G43 H05 Z2.0 M08 (APPLY CUTTER LENGTH OFFSET, MOVE TO 2" ABOVE THE PART, TURN ON THE COOLANT)
G0 Z0.1 (RAPID TO THE FEED PLANE HEIGHT)

G1 Z-0.75 F10.0 (PLUNGE TO THE START POINT OUTSIDE THE PROFILE)
G1 G41 D55 X0 Y0 F50.0 (APPLY RADIUS OFFSET COMPENSATION LEFT, LEAD IN TO THE LOWER LEFT CORNER)
G1 Y2.0 (MILL WALL 1)
G1 X4.0 (MILL WALL 2)
G1 Y0 (MILL WALL 3)
G1 X0 (MILL WALL 4)
G0 Z1.0 M09 (RAPID OUT TO CLEARANCE HEIGHT, TURN OFF THE COOLANT)

G0 G28 G91 Z0 M5 (RAPID TO THE TOOL CHANGE HEIGHT, TURN OFF THE SPINDLE)
M30 (END)

As you can see in the last example all we had to do is tell the machine to apply the cutter compensation. We used coordinates taken directly from our drawing.

This is why this is called "programming to the part profile".

Let me explain what exactly happens in the last example.
g-code G41 tells the machine to apply the compensation to the left of out finished profile. G41 is most often associated with climb milling, so many CAM systems do not bother to inform you that it is left or right, they just specify "Climb milling".
If we were to use Conventional milling, we would have to reverse the order of our toolpath, and program G42 code which enables cutter radius compensation RIGHT.

Whenever we program G41 or G42 we need to also program a lead-in move to allow machine to apply the offset.
Same goes to cancelling the offset with G40.

Here is a picture showing the difference between LEFT and RIGHT cutter radius comp.

### Important things to consider

Many machine controls have only one table for Length and Diameter offsets.
So you may have to use different offset number than the one used for the tool number or tool length.

Many controls do not allow G41,G42 or G40 move to be an arc. It almost always needs to be a straght X, Y or both move.

Lessson 2: Outside Profile, Cutter Radius Offset Compensation

Pages:(1) [1]

#### Charlie

January 29, 2014, 12:01 pm
Updated by: Eldar GerfanovJanuary 29, 2014, 12:31 pm

Thank you for taking the time to make the tutorial. But one question. How how does using cutter compensation know we're using a 1/2" End Mill? How does it know to offset half the diameter of the cutter 1/4"? I see theÂ G1Â G41Â D55Â X0 Y0 F50.0Â move, but before this the X= -0.75 and Y= -0.75. So both X and Y are moving 0.75 in the positive direction. But 0.75 isn't half the diameter of the cutter. Any input on this? Thanks again!

#### Eldar Gerfanov

January 29, 2014, 12:25 pm
Updated by: Eldar GerfanovJanuary 29, 2014, 12:31 pm

Hi Charlie,
There is D55 code in the same line as G41
G41 D55 tells the machine to apply cutter radius compensation left and that it should take number from the offset table, record number 55.
In that record we obviously should put 0.2500 , so that machine offsets by that much.
Good eye! I forgot to mention it in the description.
Thanks!
PS. We start so far away from the part, so that we don't plunge into our stock.
Also machine needs a little room to apply the comp. Some machines can do it on a dime, so we can even start 0" away from the wall, others however need to actually move atleast the compensated amont for it to work.

#### Charlie

January 30, 2014, 12:52 pm

That makes perfect sense now. THANK YOU!!

# New Comment to: Lessson 2: Outside Profile, Cutter Radius Offset Compensation

Name: *
Security Code:
*

Sing In

© 2009 Eldar Gerfanov. Materials on this site are presented as is and are mostly for educational use.

You may freely reproduce information presented herein without any consent from me, provided you include link to this site.
In case when i am not the copyright holder, you may want to contact proper owner of material. Anyway, they are freely available on the Internet.