G04 G-Code: Pause / Dwell for Precise CNC Timing

CNCCookbook’s G-Code Training

G04 is called the Dwell command because it makes the machine stop what it’s doing or dwell for a specified length of time. It’s helpful to be able to dwell during a cutting operation, and also to facilitate various non-cutting operations of the machine.

For lathe operations, the chief application of a G04 Dwell is to break chips, especially when drilling, counterboring, grooving, or parting-off. You may also find them useful in general turning or boring operations to eliminate the tooling marks left on the part by end thrust of the cutting tool.

On mills, the most common use is to force the machine to catch up. For example, you might put a G04 Dwell at the end of a long straight run that ends with a corner to make sure the machine accurately follows the path. This is sometimes necessary on older machines, though usually not on recent VMC’s. If the machine can accurately follow the path without dwells, it’s better not to use them as any dwell will leave visible marks on the part.

Non-cutting operations are even more common as dwells are used to wait for some operation to complete before going on. In a pinch, you might use a dwell to wait for your coolant to come up to pressure right after it’s turned on, for example, though it is better for cycle times if your coolant system can get to pressure without dwells. Another example is some older machines may require a dwell to give the spindle time to get up to the commanded speed.

The argument for dwell is typically the “P” word (think “Pause”), although “X” and “U” is also commonly used. You’ll have to check which format your machine uses. The address specified with the appropriate dwell word specifies the delay is either milliseconds (1000 milliseconds = 1 second) or seconds. Some controls also allow the Dwell to be programmed in spindle revolutions instead of a time, which is handy, especially for chip breaking applications. We don’t need more than a revolution or two pause to break chips so it’s easy to tell how long that is without trying to calculate an appropriate pause.

For clarity, and particularly if your machine uses “X” or “U” for dwell, put the dwell command on its own line. Here is a 500 millisecond (1/2 second) dwell between two moves:

G01 X0Y1

G04 P500

G01 X1

Remember that Dwells are always unproductive time. They’re time when the machine isn’t doing anything but is waiting for something to catch up. Try to keep dwell times as short as possible and always look for other ways to achieve your result without a dwell.

Lastly, some controls like Fanuc allow G04 without an associated word. This tells the Dwell command simply to wait until the machine is caught up with everything it is doing.

Use G04 to Create Stopping Points in G-Wizard Editor Simulations

We’ve seen that G04 is a pretty benign g-code.  It doesn’t do all that much.  We’ve provided a special function in G-Wizard Editor that you can use in your simulation runs.  Note the Jmp G04 button on the GW Editor tool bar:

Pressing the button during a simulation will advance the simulator until it finds the next G04 in your code.  So, it is a handy way rapidly move to points of interest in your g-code


1. Look up or determine what the time units and word/address formats are for your machine’s G04 command.

Next Article: G61, G64, G60 G-Code: Exact Stop & Anti-Backlash for Precise Position

Recently updated on April 28th, 2024 at 06:09 am