G-codeMotionModal group 1Mill · Lathe · 3D printer
G01: Linear Interpolation
G01 moves the tool in a straight line from where it is to the end point on the block, at the feed rate in the F word, and every axis named arrives at the same moment. It is the code for cutting in a straight line, and the F it runs at is measured along the tool path, not along any one axis. F is modal: the last F given stays in force until another one replaces it, and it is read per minute or per spindle revolution depending on which feed mode is live. G01 sits in group 01 with G00, G02 and G03, so it stays on until one of them replaces it.
Syntax
G01 X__ Y__ Z__ F__ Straight feed move (mill)
G01 X__ Z__ F__ Straight feed move, X as a diameter (lathe)
G01 X__ Y__ ,C__ Haas and Mazak mill: chamfer the corner at the end of this block
G01 X__ Y__ ,R__ Haas and Mazak mill: round the corner at the end of this blockParameters
| Address | Meaning | Notes |
|---|---|---|
X Y Z | End point | A position under G90, a distance under G91 |
A B C | End angle of a rotary axis | F on a rotary axis is in degrees a minute on a Mazak: F300. is 300 deg/min |
F | Feed rate | Modal. Per minute under G94 (G98 on a lathe), per revolution under G95 (G99 on a lathe) |
,C | Chamfer distance from the corner | Haas mill, Haas lathe and Mazak. Needs a second straight block to finish the corner |
,R | Corner radius | As ,C. On a Haas lathe a plain R works too |
I K | Haas lathe 90 degree chamfer | K with an X move, I with a Z move, never both on one block |
Example
O0201 (OUTSIDE PROFILE 100 X 60 X 6 IN 6082, FROM A 110 X 70 BLANK)
G21 G17 G40 G49 G80 G90 G94 (safe start: metric, absolute, feed per minute)
T04 M06 (12mm 3 flute carbide end mill)
G54 (X0 Y0 bottom left corner, Z0 top face)
S5300 M03 (200m/min)
G00 X120. Y-6. (6mm off the bottom edge, clear in X)
G43 H04 Z25. M08
G00 Z1.
G01 Z0. F300 (the first G01 carries its own F)
G01 X60. Z-6. F1000 (ramp along the bottom edge, 60mm in X for 6mm down)
G01 X-6. (rest of the bottom edge at depth, F1000 still live)
Y66. (left edge: G01 and F are both modal)
X106. (top edge)
Y-6. (right edge)
X50. (back over the ramp to clean it to full depth)
Y-16. (off the wall before lifting, no witness mark)
G00 Z25. M09
M05
G49
G91 G28 Z0. (Z home)
G90
M30
The ramp block moves X and Z together, and the F1000 is the speed along that sloping line, about 60.3mm long, not the speed of either axis on its own.
Controller differences
| Control | Behaviour |
|---|---|
| Fanuc | If no F has been given, the feed is taken as zero, so a G01 with no F anywhere before it does not cut. On a lathe, the C and A words of chamfering and direct drawing dimensions clash with a C or A axis: once C or A is an axis name it cannot be used as the chamfer or angle word, and bit 4 (CCR) of parameter 3405 decides how they are written. On the mill, optional chamfering and corner R cannot be used in polar coordinate mode. |
| Haas | On the mill F is per minute under G94, per revolution under G95, and G93 is inverse time. If an axis cannot reach the programmed feed, the control does not run the block and raises a max feedrate exceeded alarm. ,C and ,R need movement in both axes of the active plane and a second linear block to end the corner, with only a G04 allowed in between. On the lathe G99, per revolution, is the default, C is the C-axis motion command rather than a chamfer, and a corner chamfer or round takes a single X or Z move followed by another single move at right angles to it. It cannot be used inside a threading or canned cycle. |
| Siemens 840D | G1 with F in mm/min under G94 and mm/rev under G95. Chamfers and roundings are words on a motion block, CHF=, CHR= or RND=, with RNDM= rounding every corner that follows until RNDM=0, and FRC= or FRCM= giving them their own feed. A chamfer or rounding too big for the corner is reduced until it fits, without an alarm, unless bit 4 of MD11411 is set to raise alarm 10833. |
| Mazak | An EIA/ISO program raises a programming error if the first G01 has no F. F on a rotary axis is in degrees a minute. Corner chamfering and rounding are ,C and ,R, as on a Haas mill. |
| Okuma | On an OSP lathe the feed goes to zero when the NC is reset. A chamfer is its own G code, G75 G01 X__ L__, and a corner round is G76 G01 X__ L__, with L the size signed by the direction of the next move. Both work only in G01, only in the block that carries them, with only one of X or Z on it, and alarm if the move is shorter than L. |
| Grbl | A G1 with no feed set stops the stream with error:22, feed rate has not yet been set or is undefined. Under G93, inverse time, every G1 needs its own F or it fails the same way. |
| Marlin | F is in current units a minute and is shared with G0: the feed for a G1 is the F from the last G0 to G5 block, whichever it was. Before any F at all, moves run at DEFAULT_FEEDRATE_MM_M, 4000mm/min unless the build changes it. E moves the extruder on a printer. |
What goes wrong
A turning feed run in the wrong mode either rubs or rips. F0.2 is 0.2mm a revolution under G99 and 0.2mm a minute under G98: the tool sits against the bar, glazes it and the machine looks stalled. The reverse is the crash. A mill-minded F250 on a Haas lathe, where G99 is the default, asks for 250mm every turn, which at 1500 rev/min is 375 metres a minute. Write the feed mode into the safe start block of every program and read each F against it.
A G01 with no F before it is the next most common stop, and the controls disagree on what it means. A Fanuc takes the feed as zero, a Mazak raises a programming error and Grbl answers error:22. Marlin goes the other way: the G1 inherits the F of the last G0, so a travel move at G0 F6000 hands 6000mm/min to the first cut, and with no F at all it runs at 4000mm/min. On a router or a laser that is a snapped bit or a burnt line.
Restarting an Okuma lathe mid-program catches people next. The feed goes to zero on an NC reset, so a restart from a block with no F on it does not move. Restart from a block that states one.
Then the chamfer word. A program written for a Fanuc lathe that chamfers with a plain C, run on a Haas lathe, has C read as a C-axis move; the Haas chamfer is ,C or I and K, and the Okuma one is G75 with an L. An oversized chamfer differs too: a Siemens shrinks it to fit and says nothing, so the drawing's 2mm chamfer comes out smaller with no alarm to show for it.
Updated 21 Oct 2026