Fanuc (milling and turning)
G00 X30. Y20.It takes no F: the speed is set by the builder for each axis. It is modal, so the following blocks that only carry coordinates also run in rapid until a G01, G02 or G03 shows up.
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.
G0 and G00 specify the same rapid positioning function on controls that accept both forms. Use them to approach, retract or move between work areas without cutting. Speed depends on the machine and rapid override; F does not control the rapid move. Unlike G01, the path is not always a straight line, so check clearance above the part, clamps and vise before moving.
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 and turning)
G00 X30. Y20.It takes no F: the speed is set by the builder for each axis. It is modal, so the following blocks that only carry coordinates also run in rapid until a G01, G02 or G03 shows up.
Haas
G00 X30. Y20.Same syntax. Rapid traverse is scaled by the rapid override knob on the panel (5, 25, 50 and 100 percent), which is a separate control from the feed override: turning the feed override down does not slow a G00.
Siemens 840D / 828D
G0 X30 Y20Siemens writes G0 with no padding zero and accepts RTLION / RTLIOF to force or drop linear interpolation of the rapid, that is, to decide whether the path is a straight line or each axis running free.
Heidenhain TNC (Klartext)
L X+30 Y+20 R0 FMAXIn Klartext there is no separate code for the rapid: it is an ordinary straight-line block with FMAX instead of a feedrate. That makes it more obvious that the path is a controlled straight line.
| Letter | What it sets | Unit |
|---|---|---|
| X Y Z | Target coordinates of the move, absolute under G90 and incremental under G91. You can write one, two or all three axes in the same block. | mm / in |
| A B C | Rotary axes, if the machine has them. In rapid they turn at their top speed, which is usually very high, and with the part mounted well off the center of rotation they sweep a lot of space. | degrees |
| F | Not used. If you write an F in the G00 block the control accepts it, but it does not change the rapid speed: it is only stored as the modal feedrate for the next G01. | no effect in this block |
| G90 / G91 | They decide whether the coordinates are absolute positions or increments from where the tool is. An inherited G91 turns a positioning move into a jump. | modal, no units |
Approach and retract of a 10 mm cutter over a part clamped in a vise, with two 25 mm tall clamps at the back of the table. What the example teaches is the safe order of rapid moves: first the coordinates in the plane with Z well up, then the drop in Z already over the working point, and the other way around on the way out.
O0100 (APROXIMACION Y RETIRADA CON G00) | ( Program header. ) |
G21 G17 G40 G49 G80 | ( Millimeters, XY plane and a clean state: no offsets and no cycles active. ) |
G91 G28 Z0. | ( Sends Z to the reference point in incremental before the tool change. ) |
T1 M06 | ( Loads the 10 mm cutter. ) |
G90 G54 G00 X30. Y20. | ( First rapid: X and Y only, with Z still up at the reference point. Even if the path breaks into a dogleg, at that height there is nothing to hit. ) |
G43 H01 Z100. M03 S4000 | ( Applies the T1 length and drops in rapid to a safe Z that clears the clamps and the vise. Before this block the program Z is not the real Z of the tool tip. ) |
M08 | ( Coolant on. ) |
G00 Z2. | ( Second rapid in Z, now over the working point with nothing in the way. Coming down to 2 mm off the face is the sensible limit: any lower leaves no margin if the stock comes oversize. ) |
G01 Z-5. F120 | ( From here on it cuts, and that is why the move becomes a G01 with a feedrate. ) |
G01 X95. F600 | ( Cutting pass along the part. ) |
G00 Z100. | ( Retract: you come out in Z first. Moving in XY with the cutter still buried is the most expensive crash in the shop. ) |
G00 X30. Y20. M09 | ( With Z up, the traverse in the plane is safe. Coolant off. ) |
G91 G28 Z0. M05 | ( Z to the reference point and spindle stop. ) |
G90 M30 | ( Back to absolute and end of program. ) |
On plenty of controls the rapid is not a coordinated interpolation: every axis takes off at its own top speed and stops when it reaches its coordinate, so the real path is a diagonal that breaks the moment the shortest axis finishes. Fanuc decides it with a positioning type parameter and Siemens with RTLION / RTLIOF, and a lot of machines leave the factory in the non-linear mode. The practical consequence is serious: the simulator draws you a clean straight line between two points and the machine goes somewhere else. Never count on that straight line to clear an obstacle.
The shop rule is simple and it does not fail: going in, X and Y first with Z high, and only then down in Z over the working point; coming out, Z first and then X and Y. The rapid drop stops 1 to 3 mm off the face and the rest is done with G01, because that margin is the only thing between you and an impact if the part sits higher than expected or the stock comes oversize. If the surface is irregular or there are clamps above the working plane, the safe plane goes above the highest thing on the table.
Rapid traverse is not programmed: the builder sets it and it is usually different on each axis, with typical values between 15 and 60 m/min. The rapid override on the panel scales it in steps (5, 25, 50 and 100 percent) and it is a different knob from the feed override, so turning the feed down does not slow a traverse. That is why the first run of a new program goes single block, with the rapid at 5 or 25 percent and a hand on the emergency stop. That extra minute is what separates a scare from a bent spindle.
Yes. The control ignores leading zeros, so G0 and G00 are the same function. Writing it with two digits is only a readability convention, and it is the one almost every post processor uses; Siemens, on the other hand, always writes it as G0.
It depends on the control and on a machine parameter. In the usual mode each axis runs at its own top speed and stops when it gets there, so the path is a broken diagonal. If you need a guaranteed straight line to clear something, program the move with G01 and a high feedrate, or check how your machine is set up.
At the top speed of each axis, defined by the builder and not changeable from the program. It is usually different in Z than in X and Y, and the rapid override on the panel scales it in fixed steps. There is no way to program a slower rapid: if you want to control the speed, use G01 with an F.
You can, and the control does not complain, but it changes nothing in that block: the rapid still runs at its own speed. What does happen is that the F is stored as the modal feedrate and gets applied to the first G01 that comes along, which catches plenty of people out.
Check the work offset, tool compensation and complete path. On a mill, retract to a height that clears the part and workholding before moving in XY. For a new program, follow the machine's verification procedure with single block and a reduced rapid override. A toolpath drawing does not prove clearance above clamps or the vise.
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.