Fanuc (milling)
G01 G41 D01 X0. Y-15. F250D calls the radius offset from the tool table. Compensation has to come on in a linear move whose sideways travel is greater than the cutter radius; G40 cancels it in another linear move clear of the part.
We use technical and security cookies and, only if you accept, analytics with no cross-site tracking. More in the Cookie policy and Privacy policy.
We use first-party cookies and technical storage to make the site work, Google reCAPTCHA security technology and, only if you accept, Vercel analytics (no cookies, no cross-site tracking). You can accept or reject analytics; both options are equivalent and you can change your choice at any time. More info: Cookie policy, Privacy policy, Legal notice and Terms and conditions.
G41 tells the control to offset the toolpath by one tool radius to the left of the contour, looking in the direction of travel, using the radius stored in the D offset register. That way you program the print dimensions instead of the cutter centerline: change cutters or let one wear and you only touch the offset. With a right-hand cutter running M03, G41 gives you climb milling.
For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.
Fanuc (milling)
G01 G41 D01 X0. Y-15. F250D calls the radius offset from the tool table. Compensation has to come on in a linear move whose sideways travel is greater than the cutter radius; G40 cancels it in another linear move clear of the part.
Haas (milling)
G01 G41 D01 X0. Y-15. F250Same syntax as Fanuc. Check whether your machine offset table is set up in radius or in diameter: put a radius where the control expects a diameter and the profile comes out with half the compensation all the way around the contour.
Siemens 840D / 828D
G1 G41 X0 Y-15 F250Siemens uses G41/G42/G40 the same way, but the radius does not come from a separate D table: it comes from the active cutting edge (D1, D2...) of the tool called with T. D0 cancels all offsets.
Heidenhain TNC (Klartext)
L X+0 Y-15 RL F250RL is compensation to the left (the equivalent of G41), RR is compensation to the right and R0 cancels it. The radius comes from the R column of the TOOL.T table, and DR adds a delta oversize without touching the table.
| Letter | What it sets | Unit |
|---|---|---|
| D | Radius offset register number in the tool table: this is the amount the control shifts the path sideways. | integer (D01, D12...) |
| X Y | End point of the lead-in block and of every contour segment, already in finished part dimensions. | mm / in |
| F | Feedrate for the lead-in block and for the contour. The compensated lead-in should be a feed move, never a rapid. | mm/min under G94 |
| G17 / G18 / G19 | Plane the compensation works in. Cutter compensation only acts in the active plane; in milling that is almost always G17 (XY). | modal, no units |
Finish pass around the outside profile of an 80 x 60 mm aluminum plate, with a 12 mm cutter and offset D01 = 6.0 mm radius. The G54 origin sits at the lower left corner of the finished profile and the path runs clockwise seen from above, which with M03 is climb milling.
O0041 (PERFIL EXTERIOR CON G41) | ( Program header. ) |
G21 G17 G40 G49 G80 | ( Millimeters, XY plane and everything cancelled: cutter compensation, tool length offset and canned cycles. ) |
G91 G28 Z0. | ( Sends Z to the reference point in incremental before the change. In G90 the block would dive to the part Z0 first. ) |
T1 M06 | ( Loads the 12 mm cutter. ) |
G90 G54 G00 X-25. Y-15. | ( Absolute, work offset and rapid to a start point clear of the material, on the extension of the left wall. ) |
G43 H01 Z50. M03 S3200 | ( Tool length offset for T1 and spindle on. H01 is the offset register for T1. ) |
M08 | ( Coolant on. ) |
G00 Z-5. | ( Rapid down to the depth of cut: safe to do because the cutter is still clear of the part. ) |
G01 G41 D01 X0. Y-15. F250 | ( Turns compensation on to the left in a 25 mm straight lead-in, well above the 6 mm radius. At the end of the block the cutter center sits 6 mm off the programmed point. ) |
G01 Y60. | ( Left wall X0 climbing in +Y. Looking toward +Y, the material is on the right of the direction of travel: exactly what G41 asks for. ) |
X80. | ( Top wall Y60. The control rolls around the outside corner on its own. ) |
Y0. | ( Right wall X80, heading down. ) |
X-15. | ( Bottom wall Y0 and lead-out along the extension, already clear of the material. ) |
G01 G40 X-25. | ( Cancels compensation in a linear move and with the cutter outside the part. ) |
G00 Z50. M09 | ( Retract in Z and coolant off. ) |
G91 G28 Z0. M05 | ( Z to the reference point and spindle stop. ) |
G90 | ( Puts the control back in absolute. ) |
M30 | ( End of program and rewind. ) |
The side has nothing to do with whether the contour is outside or inside: it depends on where the material sits as you look along the direction of travel. Stand on top of the cutter facing the way it is going: if the material is on your right, the cutter shifts left and you want G41; if it is on your left, you want G42. In practice, with a right-hand cutter running M03, G41 is what you get running an outside profile clockwise and a pocket counterclockwise, which are the two climb milling cases.
G41 needs a linear lead-in block to ramp the offset in: the control shifts the end of that block perpendicular to the next move, so the lead-in has to travel sideways more than the cutter radius and it has to start clear of the material. Same rule going out with G40. Most programs lead in and out along the extension of the first and the last wall, or with a tangent arc after turning compensation on in a straight move. G41 lives alongside G43: one compensates radius in the plane, the other length in Z.
The control does not change the part, it changes where the cutter center travels. That is why the D offset is the dimensional adjustment lever in the shop: if the profile comes out 0.04 mm oversize you edit the offset, not the program. The same mechanism lets you leave finish stock by adding it to the radius (D = 6.2 leaves 0.2 mm per side) and then take the finish pass with the same program and the real value. It also lets you rerun the program with a different cutter diameter without reposting.
Of the path, not of the print or the machine. Picture yourself standing on the cutter looking the way it is feeding: G41 shifts it toward your left hand. Put the other way around, with G41 the material is on the right of the direction of travel and with G42 it is on the left.
It depends on rotation. With a right-hand cutter running M03, which is the normal case, G41 gives climb milling. If the tool is left-hand or the spindle runs M04 the relationship flips and G41 becomes conventional milling.
Most controls allow it, but it is a bad idea: the offset ramps in during a rapid move close to the part. Turn it on in a G01 at approach feed and with the cutter well clear of the material.
Whatever your machine offset table expects, which is a control setting. Confirm it with a test pass and measure the part. If you want to leave finish stock, add it to the offset value instead of editing the program.
Almost always one of three things: the lead-in block is shorter than the cutter radius, compensation is switched on in an arc, or the contour has an inside radius or a slot narrower than the tool. Check those three before you touch anything else.
CNC IDE: editing with G/M tooltips, line inspector, conversion between controls and 2D/3D toolpath.
CNC Alarms and Solutions Guide. Enter the error code or symptom to find the cause and how to repair it at the machine.
Estimate CNC turning and milling cycle time from G-code. Calculate parts per hour with a breakdown of cutting, rapids, canned cycles and tool changes.