CNC Coolant Control M-Codes: M07, M08, M09 and Through-Spindle Coolant
CNC coolant M-codes control auxiliary functions that supply or stop cutting fluid during machining. Common examples include M08 for conventional coolant activation and M09 for coolant deactivation, while M07 and through-spindle coolant commands can vary by controller and machine configuration.
The code number alone is not enough to determine exactly what a machine will do. For example, Haas defines M07 as "Shower Coolant On" and uses M88/M89 for through-spindle coolant on/off, while LinuxCNC documents M7 as mist coolant and M8 as flood coolant. Always verify the applicable machine manual and post-processor before running a program.
What Do CNC Coolant M-Codes Do?
They switch auxiliary coolant functions — they do not describe the cutting tool's motion path.
Coolant M-codes are part of a program's auxiliary commands. They tell the control to start or stop a coolant function: flood, mist, shower, or a through-spindle supply, depending on what the machine is equipped with. They run alongside the motion commands (G-codes) and spindle commands (S/M03/M04/M05) but do not by themselves define geometry, feed or speed.
That separation matters: a coolant command requests a function, but whether that function is physically available, at what pressure, and through which nozzle, is decided by the machine's hardware and configuration. The code is an instruction, not a guarantee of delivered fluid.
Buyer / programmer takeaway: treat every coolant M-code as machine-specific. The same number can trigger a different action on a different control.
CNC Coolant M-Code Quick Reference
Common definitions and — just as important — the boundaries you must not assume across machines.
| Code | Common function / example | Boundary the page must state |
|---|---|---|
| M07 / M7 | On some systems enables mist coolant; on a Haas mill it is defined as Shower Coolant On. | Not every controller defines M07 as mist. Confirm per machine. |
| M08 / M8 | Commonly starts conventional coolant, e.g. flood coolant. | Actual output depends on the machine's coolant configuration. |
| M09 / M9 | Commonly stops the conventional coolant function. | Do not assume it turns off every special cooling option. |
| M88 / M89 | On a Haas mill, through-spindle coolant ON / OFF. | Given only as a Haas example; not a default for other brands. |
| Other machine-specific M-codes | May control high-pressure coolant, air blast, nozzle, aux valve or custom output. | Must be checked against the specific model's manual; function cannot be inferred from the number alone. |
Why the boundaries matter
Haas's published mill code list defines M07 as Shower Coolant On and lists M88/M89 separately for through-spindle coolant. LinuxCNC documents M7 as mist coolant and M8 as flood coolant. Both are real, authoritative sources — and they show the same code does not mean the same action everywhere.
M07 vs. M08: Mist, Shower and Flood Coolant
The code is not the cooling method. The method is set by hardware; the code only requests it.
| Cooling method | Typical purpose | Programming emphasis |
|---|---|---|
| Flood coolant | Delivers a larger volume of fluid to the cut for cooling, lubrication and chip evacuation. | Nozzle direction, volume, and reach to the cutting zone. |
| Mist coolant | Atomizes fluid and directs it to a defined area. | Requires the right equipment; verify the exact code definition. |
| Shower coolant | A machine-defined shower cooling function. | Meaning and hardware depend on the machine manual. |
| Through-spindle (TSC) | Delivers fluid through the spindle and a qualified tool to the cut. | Requires option fitment, tool channel, pressure and a specific control code. |
Code ≠ hardware: issuing a code does not confirm flow rate, pressure or nozzle position meet the process need. Verify the physical result.
What Does M09 Turn Off?
It stops the controller-defined conventional coolant — not necessarily every cooling system.
M09 is widely used to stop the coolant that M08 (or the machine's conventional coolant command) started. On many machines that covers the flood or shower supply. But on machines fitted with through-spindle coolant, high-pressure units or separate auxiliaries, those functions may have their own dedicated off commands.
So the safe statement is: M09 turns off the conventional coolant function as defined by that controller. For any special system, confirm its shutdown command and sequence from the machine documentation and the post-processor output.
Through-Spindle Coolant: Machine-Specific M-Codes
A concrete example helps — but never generalize one brand's code to every machine.
Through-spindle coolant (TSC) supplies fluid through the spindle and a tool with an internal channel, reaching the cut from inside the tool. It needs the option fitted, a qualified tool, adequate pressure and the correct control command.
On a Haas mill configured for TSC, M88 and M89 are the documented coolant on/off commands. Other builders may use different codes, or even custom functions, for the same purpose. Some machines document TSC under codes such as M67/M68, but those are not universal — they must be confirmed against that specific machine's manual.
Verification rule
Before using any TSC command, confirm: (1) the machine is actually equipped for through-spindle coolant; (2) the tool has the required internal channel and pressure rating; (3) the M-code matches the machine's operator manual; and (4) the post-processor outputs that code. Do not copy a code from another controller.
CNC Coolant M-Code Programming Examples
Structure illustrations only — not complete programs for any specific machine.
Example A — Conventional coolant on/off (illustrative structure)
(ILLUSTRATIVE STRUCTURE ONLY) S6000 M03 M08 (Verified machining operations go here) M09 M05 M30
Explanation: S6000 M03 requests a spindle speed and forward rotation; whether they can share a block depends on the controller syntax and machine rules. M08 is a common conventional-coolant-on command, but its real function follows the machine definition. M09 stops the conventional coolant; M05 stops the spindle and M30 ends and resets the program, with exact end behavior controller-dependent. This snippet is a teaching structure, not a complete, machine-ready program.
Example B — Through-spindle coolant (Haas example)
On a Haas mill configured for TSC: M88 (through-spindle coolant ON) ... M89 (through-spindle coolant OFF)
Explanation: M88/M89 are the documented Haas TSC on/off commands. Other machines may use different commands or custom functions. Verify the machine's operator manual and post-processor before using a TSC command — do not assume one controller's code works on another.
Example C — Waiting for coolant to establish
Do not apply a fixed dwell such as "wait 2–3 seconds" to every setup. If the machine requires time to establish flow or pressure, use the verified sequence specified by the machine builder. Where available, rely on the intended pressure or flow confirmation logic rather than assuming a fixed dwell works for every configuration.
Why no fixed number: pump type, pressure, line length, nozzle, sensors and interlocks differ, so a single dwell cannot be correct for all equipment.
How to Verify Coolant Control Before Machining
A coolant code that runs without alarm is not proof of delivered fluid.
Match every coolant M-code to the controller and machine manual.
Flood, mist, shower or TSC — and that the hardware exists.
Issue the correct on-command for the chosen function.
Check real flow, pressure and nozzle direction at the cut.
Stop each function with its defined off-command and sequence.
| Check | What to confirm |
|---|---|
| Controller & machine | Which machine and controller version the program was written for. |
| Coolant hardware | Whether flood, mist, shower or TSC is actually fitted and configured. |
| Code mapping | That every coolant M-code matches the machine manual. |
| Post-processor | That CAM outputs the correct coolant codes for the real machine. |
| Start / stop logic | That coolant on/off aligns with machining phases and tool changes. |
| Supply verification | Whether flow, pressure, nozzle direction or pressure-build status must be confirmed. |
Common CNC Coolant M-Code Mistakes
Most problems come from assuming one rule fits every machine.
Wrong code mapping
Copying an M-code from another controller without checking the target machine manual.
Assuming M09 stops everything
TSC or high-pressure options may need their own separate off command.
Generic TSC code
Using M67/M68 (or any code) as if universal instead of confirming the machine's command.
Fixed dwell assumption
Applying a set 2–3 s wait when pressure and pump setups differ.
Post-processor mismatch
CAM emits a coolant option the real machine does not map correctly.
Code runs, fluid doesn't
No verification of actual flow, pressure or nozzle at the cutting zone.
Why Coolant Control Matters in CNC Machining
Correct coolant management affects quality and repeatability — not just operator comfort.
Tool wear
The chosen delivery method must match the cutting condition; inadequate supply can degrade tool state.
Chip evacuation
Deep holes, pockets and some drilling need special attention; a code alone does not guarantee chips clear.
Surface finish
Cooling, lubrication and cutting parameters all influence finish — not the M-code alone.
Thermal management
Good strategy helps control heat, but effect depends on material, tool, condition and process route.
Process repeatability
Switching between cooling options should be explicit and verifiable, especially on multi-option machines.
No unsupported percentages
This guide does not claim fixed gains such as "M08 improves tool life by 30%" or "surface improves by 50%." Such figures require controlled material, tool, condition and test data. The point is disciplined verification, not a number.
CNC Coolant Control Checklist Before Production
A practical pre-run check for engineers and procurement alike.
| Item | Confirm |
|---|---|
| Controller & machine | Which machine and controller version is the program written for? |
| Cooling hardware | Is the required flood, mist, shower or TSC configuration present? |
| Code mapping | Do all coolant M-codes match the machine manual? |
| Post-processor | Does CAM map coolant options to the actual machine codes? |
| Start / stop logic | Does coolant on/off fit machining phases and tool changes? |
| Supply verification | Must flow, pressure, nozzle direction or pressure-build be confirmed? |
| Abnormal cases | Is there a verified response for low pressure, clogged filter or lost supply? |
| Production records | Does the job need program-version, trial-run or inspection records? |
Frequently Asked Questions
What is the difference between M07 and M08?
The meaning of M07 depends on the controller. In LinuxCNC, M7 is documented as mist coolant and M8 as flood coolant. On a Haas mill, M07 is defined as Shower Coolant On. M08 is a common conventional coolant-on command, but its actual output depends on the machine's coolant configuration. Always confirm the definition in the machine manual rather than assuming a fixed mapping.
What does M09 turn off?
M09 commonly turns off the controller-defined conventional coolant function, such as flood or shower cooling. It should not be assumed to turn off every special cooling option. Through-spindle coolant and other auxiliary systems may have their own separate off commands, so verify the shutdown logic for each cooling function used.
What M-code controls through-spindle coolant?
On a Haas mill configured for through-spindle coolant (TSC), M88 and M89 are the documented on/off commands. Other machines may use different codes or custom functions. Check the specific machine's operator manual and post-processor before using any TSC command; do not apply one brand's code to another controller.
Are CNC coolant M-codes the same on every controller?
No. While M08/M09 for coolant on/off is a common convention, the exact function of any M-code is set by the controller, the machine builder and any optional systems fitted. The same code number can perform a different action on a different machine. The machine manual and the CAM post-processor are the authoritative sources.
Should M09 always be used before a tool change?
Turning off the relevant coolant before a tool change is a common programming practice, but it should follow the target machine's coolant and tool-change sequence rather than replace it. Different cooling configurations and post-processor outputs can change the required order, so confirm the sequence against the machine's documented procedure.
How can I confirm coolant is working before cutting?
Confirm that the commanded code maps to the actual hardware, that the coolant type and nozzle are correct for the operation, and that real flow and nozzle direction meet the process need. If the machine provides pressure or flow monitoring, follow its verification routine. A code that executes without alarm does not by itself prove adequate coolant delivery.
Need a CNC part machined to drawing?
Send the model, material, tolerances and finish requirements. Our engineering team reviews the machining route, coolant strategy and any documentation needs against your specification.
- Process and coolant strategy matched to material and feature
- DFM input on tolerances, tooling and verification
- Agreed inspection and material documentation on request
Reviewed the coolant M-code content for this guide on 2026-10-14. M-code definitions reference publicly documented controller sources (Haas operator manuals, LinuxCNC documentation); exact functions are machine-specific. This is a technical reference — no experimental or production-performance claims are made.
