---
title: "CNC Spindle Warm-Up Program: G-Code and Schedule"
description: "Why cold spindles wear fast and cold machines cut off-size parts: a staged RPM warm-up program you can adapt, with dwell, axis strokes, and scheduling."
url: https://gcodepractice.com/journal/cnc-spindle-warm-up-program-g-code/
canonical: https://gcodepractice.com/journal/cnc-spindle-warm-up-program-g-code/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-08-13
updated: 2026-08-13
category: "Guides"
tags: ["warm-up", "spindle", "g-code", "maintenance", "accuracy", "setup"]
lang: en
---

# CNC Spindle Warm-Up Program: G-Code and Schedule

> **TL;DR** A warm-up program steps the spindle through staged speeds with dwells, plus slow axis strokes, before the first cut of the day: it distributes cold bearing lubrication gradually and brings the machine to the thermal state it will cut in, ending the morning-scrap pattern where early parts trend at a tolerance edge. Twenty minutes covers most machines after an overnight stop; follow the builder's schedule where one exists, match the top stage to the day's work, and skip it only on machines that never cool.

A CNC warm-up program is a short G-code routine that runs the spindle through a staircase of increasing speeds, usually with slow axis motion mixed in, before the machine cuts its first part of the day. It exists for two physical reasons. Cold spindle bearings have not yet distributed their lubricant, and running them straight to high RPM from cold is a proven way to shorten their life, which is why machine builders specify warm-up procedures in their manuals. And a machine changes size as it warms: spindle growth in Z alone can move the tool tip by several hundredths of a millimeter between cold start and thermal equilibrium, enough to take the first parts of the morning out of tolerance while the afternoon's parts measure fine. Twenty minutes of programmed warm-up costs nothing but a scheduled start; it buys bearing life and a machine that cuts the same at 7:20 as at noon.

## Why cold machines misbehave

The bearing story first. Machine spindles ride on precision rolling bearings whose grease or oil-air lubrication needs motion and temperature to distribute properly. At cold start the lubricant sits where it settled; the first minutes of rotation spread it into a working film. Sending a cold spindle straight to its maximum speed asks the bearings to survive their highest loads on their thinnest film, and the damage is cumulative and invisible, a shortened life discovered years early rather than a dramatic failure on the spot. Builders' manuals encode this as staged warm-up schedules, and the specific schedule in your machine's manual overrides any generic advice, including the schedule below.

The accuracy story is thermal. Metal structures expand as they warm, per the ordinary physics of [thermal expansion](https://en.wikipedia.org/wiki/Thermal_expansion), and a machine tool is a large metal structure with concentrated heat sources: spindle bearings, ballscrew nuts, servo motors, hydraulics. As the spindle cartridge warms it grows, moving the tool tip, predominantly in Z; as ballscrews warm they lengthen, shifting positioning subtly along each axis. The machine at 8 a.m. and the machine at 1 p.m. are two slightly different sizes, and parts inherit that difference. Shops see it as the classic morning pattern: first parts trending at one edge of tolerance, drifting toward center as the day goes on, exactly the kind of signature worth confirming with measurements rather than folklore, in the spirit of [reading G-code and the machine to find errors](/journal/how-to-read-g-code-to-find-errors/) instead of guessing.

Warm-up attacks both at once: it brings the spindle to operating temperature on a schedule the bearings tolerate, and it moves the structure to (or toward) the thermal state in which the day's work will actually run, so offsets set after warm-up describe the machine that will cut the parts.

## A warm-up program you can adapt

Here is a straightforward mill warm-up in the 20-minute class, staged RPM with gentle full-travel axis motion. Adapt the speeds to your spindle's maximum and your builder's schedule; the structure is the point.

```
O0001 (MORNING WARM-UP, ~20 MIN)
G90 G94 G17 G40 G80 G49
(stage 1: low speed, 5 min)
S500 M03
G04 P60. (dwell 60 sec)
G91 G01 X-10.0 F100. (slow axis strokes)
G01 X10.0
G01 Y-6.0
G01 Y6.0
G01 Z-4.0
G01 Z4.0
G04 P240.
(stage 2: mid speed, 5 min)
S2000 M03
G04 P300.
(stage 3: high speed, 5 min)
S5000 M03
G04 P300.
(stage 4: top band, 5 min)
S8000 M03
G04 P300.
M05
G90
M30
```

The G04 dwells hold each stage; the [dwell code's format quirks](/journal/g04-dwell-time-format-fanuc-vs-haas/) matter here, since P words mean seconds or milliseconds depending on control and decimal point, and a warm-up that dwells for 300 milliseconds instead of 300 seconds warms nothing. The incremental axis strokes distribute ballscrew and way lubrication; keep them slow and well inside travel limits, and switch back to [G90 absolute mode](/journal/g90-vs-g91-crash-prevention/) explicitly at the end so the next program does not inherit G91. Shops that want the program cleaner factor the stages into a subprogram taking stage time and speed as repetition, the classic [M98/M99 structure](/journal/m98-and-m99-subprogram-fanuc-example/).

| Stage | Spindle speed | Duration | Purpose |
| --- | --- | --- | --- |
| 1 | ~10 % of max | 5 min | Lubricant distribution at minimal load |
| 2 | ~25 % of max | 5 min | Gentle temperature ramp |
| 3 | ~60 % of max | 5 min | Approach working thermal state |
| 4 | ~80-100 % of max | 5 min | Stabilize at the day's top band |

Two scheduling refinements pay for themselves. Machines with timer or scheduling functions can start warm-up before the shift so the machine greets the crew ready; where that is not available, making warm-up the first line of the morning routine, started before coffee, achieves the same with human scheduling. And the top stage should reflect the day's actual work: a day of 3,000 RPM steel work does not need ten minutes at 12,000 RPM, while a day of high-speed aluminum finishing does.

## When warm-up matters most, and when it is overkill

The need scales with speed, precision, and idle time. High-speed spindles, the 12,000 RPM and up class, are the least tolerant of cold starts and the most explicit in their manuals; many builders void warranty arguments around documented warm-up neglect. Tolerance-critical work amplifies the thermal side: chasing hundredths of a millimeter on a machine that is itself moving by hundredths as it warms is a losing game, so precision shops warm up before setting [work offsets](/journal/g54-work-offsets-explained/) and before first-article runs. Idle time resets the clock: Monday mornings, post-holiday starts, and machines that sat through a long lunch in an air-conditioned shop drifting back toward ambient all deserve the routine, with longer idles deserving the longer version.

The honest other side: a machine that runs around the clock in a temperature-controlled shop is already at equilibrium, and its warm-up is a token minute or nothing at all. Roughing work with generous tolerances does not care about a few hundredths of thermal drift, though its spindle bearings still care about cold high-RPM starts. And warm-up is not a universal cure: it does not fix a worn spindle, does not substitute for probing when fixturing changes, and does not remove the need for in-process measurement on long precision runs, where some shops re-touch offsets after the machine has been cutting an hour. The routine is one leg of accuracy, alongside measurement and maintenance, not a replacement for either.

Operators inherit warm-up as culture as much as code: it is the sort of practice a [first-week operator](/journal/first-week-as-a-cnc-operator-what-to-expect/) learns from whoever opens the shop, and the machines that skip it are usually the machines whose owners never connected morning scrap to cold iron. Making the program a numbered fixture of the machine, O0001 or the shop's convention, with the schedule written in comments, turns the culture into an artifact new people find by themselves.

## Lathe and router variants

Turning centers warm up on the same logic with two additions: the turret gets exercised through a few index cycles to distribute its lubrication, and machines with live tooling give the driven-tool spindle its own staged ramp, since it has its own small bearings with the same cold-start physics. Sub-spindle machines run both spindles through the schedule. Y-axis and milling-capable lathes add the gentle axis strokes across their full working envelope.

The measurement habit that pairs with all of this is a five-minute morning check some precision shops formalize: after warm-up, touch a master tool against a fixed reference, a tool setter, a gauge block on the table, and log the reading. Over weeks that log becomes the machine's thermal fingerprint, showing exactly how much the reference moves between cold and warm and how long stabilization really takes on that machine in that shop, replacing generic assumptions with the machine's own data. It also catches the day something changes: a reading outside the usual band flags a coolant chiller fault or a failing bearing before the parts do.

Routers and hobby machines scale the idea down without abandoning it. Many router spindles are high-RPM units with small bearings, exactly the geometry that suffers most from cold maximum-speed starts, so a few minutes stepping from low to working RPM is cheap insurance even on a machine that cost less than a single industrial spindle rebuild. Air-cooled spindles also benefit from a stabilization period so their thermal growth happens before the first cut rather than during it. The axis-stroke portion matters less on machines with rolling-element guides and more on anything with plain ways relying on oil distribution.

## Bottom line: twenty minutes that buy the morning

Warm-up is two protections in one short program: staged RPM protects cold bearings on their way to operating temperature, and reaching thermal equilibrium before cutting means the machine that gets offset is the machine that cuts the parts. Structure it as an RPM staircase with dwells and slow axis strokes, match the top stage to the day's work, schedule it before the shift where possible, and follow the builder's specific schedule where one exists. Skip it only on machines that never cool down, and never mistake it for a substitute for measurement. Cold iron cuts different parts than warm iron; the program exists so both of those machines are the same one by first cycle start.

## Frequently asked questions

### What is a CNC spindle warm-up program?

A short G-code routine, typically 15 to 30 minutes, that steps the spindle through increasing speeds with dwells at each stage, usually adding slow axis strokes, before the first real cut of the day. It distributes bearing lubrication gradually instead of shocking cold bearings at full RPM, and it brings the machine's structure to the thermal state it will cut in, so morning parts measure like afternoon parts. Builders' manuals often specify an exact schedule; that schedule wins over any generic one.

### How long should a CNC machine warm up?

Twenty minutes in staged speeds covers most machines after an overnight stop; longer after weekends or in cold shops, shorter or none for machines running continuously at equilibrium. The practical test is measurement: if first-of-morning parts trend at one tolerance edge and drift centerward over the first hour, the warm-up is too short for the precision being asked. High-speed spindles sit at the long end of the range and their manuals are the least optional.

### Does warming up really prevent spindle damage?

Staged warm-up addresses a specific, well-documented mechanism: cold bearings running maximum speed on an undistributed lubricant film wear faster, and the damage accumulates invisibly as shortened life rather than a dramatic failure. Builders specify warm-up schedules for exactly this reason. What warm-up cannot do is repair existing wear, fix imbalance, or substitute for lubrication system maintenance; it is the cheapest layer of spindle care, not the whole of it.

### What should be in the warm-up G-code besides spindle speeds?

Dwells (G04) to hold each stage, watching the control's dwell-format quirk of seconds versus milliseconds; slow incremental axis strokes across a safe span of each axis to distribute way and ballscrew lubrication; a turret index cycle and live-tool ramp on lathes; and explicit mode restoration at the end, G90 and canceled modal states, so the next program starts clean. Numbering it as a standing program with the schedule in comments makes it survive personnel changes.

### What is the best way to learn the codes used in a warm-up program?

The warm-up program is a friendly first program to read because it uses a small, honest vocabulary: S and M03/M05, G04 dwells, G90/G91, and simple feeds. Drilling that vocabulary until it is automatic is exactly what a free app like G-Code Sprint does, short timed quizzes on the everyday codes with the missed ones repeating, and the warm-up routine then becomes something you can write from memory for any machine in the shop.

## Sources

- [Wikipedia: Thermal expansion](https://en.wikipedia.org/wiki/Thermal_expansion)
- [LinuxCNC G-code reference](https://linuxcnc.org/docs/html/gcode/g-code.html)
- [HelmanCNC: Fanuc M-code list](https://www.helmancnc.com/fanuc-m-code-list/)

---

Source: https://gcodepractice.com/journal/cnc-spindle-warm-up-program-g-code/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
