---
title: "G-Code for Automatic Tool Changers on Wood Routers"
description: "On an ATC router the file just says T2 M6; a macro does the choreography. Here is the sequence, the rack vs carousel difference, and the per-tool Z that matters."
url: https://gcodepractice.com/journal/g-code-for-automatic-tool-changers-on-wood-routers/
canonical: https://gcodepractice.com/journal/g-code-for-automatic-tool-changers-on-wood-routers/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-06-04
updated: 2026-06-04
category: "Practice"
tags: ["atc", "wood-router", "tool-change", "g-code"]
lang: en
---

# G-Code for Automatic Tool Changers on Wood Routers

> **TL;DR** On a wood router with an automatic tool changer, the program calls T plus M6 exactly like a mill, and the control runs a macro behind M6 that orchestrates the real sequence: spindle stop, Z clear, dust shoe lift, pocket pickup or carousel index, drawbar, and usually a length probe. The G-code skill is the frame around the call: correct tool numbers, G43 length offsets per tool, and a safe restart. Routers without an ATC fake it with a pause and a re-zero.

An automatic tool changer turns a [wood router](https://en.wikipedia.org/wiki/CNC_router) from a one-bit machine into a production cell, and the G-code side of it is smaller than newcomers expect: the program says `T2 M6`, and a macro does everything else. Knowing what lives on each side of that line is the whole literacy.

## What does the program actually contain?

The same frame a machining center uses:

```
M5                 (spindle off before the change)
T2 M6              (select pocket 2, change)
S18000 M3          (new tool up to speed)
G43 H2             (tool 2's length offset)
G0 X.. Y.. Z25.    (approach with the new length active)
```

The [M6 definition](https://linuxcnc.org/docs/html/gcode/m-code.html) is one word, and behind it the control runs a builder-configured macro: Z to a safe height, dust shoe lifted, travel to the pocket or carousel position, drawbar release, pickup, clamp, and on most ATC routers a stop at the fixed touch plate to probe the new tool's length. The choreography is real machine motion, but none of it appears in your file, which is exactly the arrangement mills use, the sequence walked through in [the M06 tool change explainer](/journal/m06-tool-change-explained/).

## Rack or carousel: does the code care?

No, and that is worth internalizing:

| | Rack / pod changer | Carousel changer |
| --- | --- | --- |
| Tools live | Fixed pockets along the bed or gantry | Rotary magazine on the gantry |
| Change motion | Spindle drives to the pocket | Carousel indexes to the spindle |
| Speed | Slower, travel-dependent | Faster, consistent |
| Program calls | `T_ M6` | `T_ M6` |

The program is identical; the macro differs. The practical consequence: programs port between ATC routers easily, while macro problems, a mis-taught pocket position, a drawbar timing fault, are machine-setup issues no program edit fixes, which is the first diagnostic fork when a change goes wrong.

## Why is the length offset the half that bites?

Because router tooling is collet-based, and stick-out varies with every regrip, unlike presettable mill holders. Each pocket's tool therefore carries a measured length in the offset table, applied with [G43 and its H register](https://linuxcnc.org/docs/html/gcode/g-code.html) after every change, the system explained in [the G43 tool length offset guide](/journal/g43-tool-length-offset-explained/). ATC routers defend those values by probing each tool on a fixed plate during the change macro, and the defense matters: a stale length on a 18,000 RPM router bit is an air cut on the lucky day and a snapped bit through the spoilboard on the other one.

A concrete failure pattern: after a bit change done by hand outside the ATC workflow, pocket 3's stored length was 6 mm stale, and the next job's first plunge buried the new, longer bit. The fix was procedural, not programmatic: any hand-touched tool gets re-probed before the pocket is trusted, a one-line shop rule that retires the whole failure class.

## What about routers without an ATC?

The same logic with the human as the changer. `M6` (or `M0`) pauses, the operator swaps the bit, and because collet stick-out never repeats, the Z reference must be re-established per tool, by touch plate or paper feel, before resuming. Hobby controls vary in how they handle the pause-and-probe flow, and the wider code context for those machines, including the repurposed coolant outputs, lives in [the wood router M-codes list](/journal/cnc-wood-router-m-codes-list/). The discipline transfers upward: makers who learn the per-tool Z habit on a pause-change machine arrive at ATC routers already respecting the offset table.

## Bottom line

ATC G-code on routers is the mill pattern: `T` plus `M6` in the file, choreography in the macro, and `G43` carrying each tool's measured length. Rack and carousel differ in hardware, not program. The offsets are where it bites, so probe what the hands touch, and drill the tool-change family until the frame writes itself, the recall layer the [G-code practice hub](/g-code-practice/) covers free.

## Sources

- [LinuxCNC M-code reference (M6)](https://linuxcnc.org/docs/html/gcode/m-code.html)
- [LinuxCNC G-code reference (G43 tool length)](https://linuxcnc.org/docs/html/gcode/g-code.html)
- [Wikipedia: CNC router](https://en.wikipedia.org/wiki/CNC_router)

## Frequently asked questions

### What G-code runs an automatic tool changer on a wood router?
`T` selects and `M6` changes, exactly like a mill, with a builder macro behind `M6` doing the physical sequence. The file's job is the frame: right tool numbers, `G43` per tool, clean restart.

### What is the difference between rack and carousel tool changers on routers?
Racks hold tools in fixed pockets the spindle drives to; carousels rotate tools into position on the gantry. The program calls both identically; only the hidden macro differs.

### Why does every tool need its own length offset on a router?
Collet stick-out never repeats, so each pocket's tool carries a measured length applied via `G43`, usually verified by a probe in the change macro. Stale lengths break bits.

### What is the best way to learn the tool-change codes for a router?
Drill `T`, `M6`, and the offset codes until the sequence narrates itself. A free app like G-Code Sprint quizzes the tool-change family and repeats whichever codes you miss.

*G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.*

---

Source: https://gcodepractice.com/journal/g-code-for-automatic-tool-changers-on-wood-routers/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
