Back to GSM Code List

M08 and M09: the coolant of the machine

M08 opens the machine coolant, which on almost every machine is the flood of cutting fluid, and M09 shuts it. They are among the simplest codes there are and, at the same time, among the ones that cause the most trouble when they are missing: a forgotten M09 before the tool change sends coolant into the magazine and into the taper of the next tool, and a forgotten M08 leaves a deep drill working dry. M09 shuts every coolant output at once, the mist of M07 included.

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.

Family
Machine
Machine
Milling, Turning, Mill-turn
Risk
Low
Example
M08 / M09

Syntax by control

Fanuc

M08

No arguments. If the M goes in a block with a move, the instant it runs (before or after the travel) depends on the control and on the PLC, so when the timing matters it pays to write it in its own block.

Haas

M08

Same as Fanuc. Haas warns when the tank level is low and lets the coolant be locked out from the panel: if the operator has disabled it, the M08 in the program opens nothing and the cycle carries on as if nothing had happened.

Siemens 840D / 828D

M8

Written with no leading zero. As with the rest of the machine M codes, what each output opens is defined by the builder in the PLC; M8 and M7 are the two circuits the standard provides for.

Heidenhain TNC (Klartext)

M8

M8 opens and M9 closes. On many TNCs the coolant can also be tied to each tool from the table, so it opens on the tool call without writing the M in the program.

Through-spindle coolant

M88 (ejemplo de Haas)

High pressure internal coolant is not M08: on Haas it is opened with M88 and closed with M89, and other builders use their own numbers. A long drill with coolant holes needs that circuit, not the external flood.

Address letters used with it

LetterWhat it setsUnit
No address lettersM08 and M09 take no arguments. Flow, pressure and nozzle aim are set on the machine, not in the program.no units
M07The other coolant output, normally mist or air. It is opened separately, but it shares its shutdown with M08: the M09 closes both.no units
Timing within the blockNot a letter, but worth bearing in mind: in a block with a move, some controls run the M as the travel starts and others as it ends.depends on the control
G04 P (associated dwell)A dwell put in after the M08 to give the pump time to build pressure before the tool goes into the material.ms on Fanuc, seconds with decimals on Haas

Worked example

Drilling a 10 mm hole 60 mm deep in steel: six diameters, so it runs with a G83 peck cycle and plenty of coolant. The example shows the three places where coolant matters: before going in, during the pecking and, above all, before coming up to the tool change position.

O0008 (TALADRADO PROFUNDO CON REFRIGERANTE)
( Program header. )
G21 G17 G40 G49 G80
( Millimeters, XY plane and a clean state. )
G91 G28 Z0.
( Z to the reference point in incremental before the change. )
T6 M06 (BROCA D10)
( 10 mm drill. )
G90 G54 G00 X50. Y40. S1400 M03
( Absolute, work offset, positioning over the hole and spindle on. )
G43 H06 Z50.
( T6 length offset. )
M08
( Opens the flood with the tool still up and in its own block, so the pump has time to build pressure. )
G04 P1000
( One second of dwell. The pump does not give flow instantly and the first peck is what decides whether the chips come out or pack down the hole. )
G99 G83 Z-62. R3. Q8. F120
( Pecking 8 mm at a time, coming out to the R plane on each one. The coolant does two jobs here: cooling the edge and dragging the chips out. )
G80 G00 Z50.
( Cancels the cycle and retracts in Z. )
M09
( Shuts the coolant before going up to the reference point. Left open, the nozzle waters the carousel and the fluid ends up inside the taper of the next tool. )
G91 G28 Z0. M05
( Z to the reference point and spindle stop, with the machine already dry. )
G90 M30
( Back to absolute and end. Whether the M30 shuts the coolant off by itself depends on the machine: do not count on it. )
Open the simulator to check the example

Practical keys to using M08/M09 in the workshop

When you need flood and when it gets in the way

Coolant is compulsory when chips have to come out of an enclosed place or temperature has to be held: deep drilling, reaming, tapping, turning stainless, finish passes with a tight tolerance where the part expanding shows up. It gets in the way in milling with carbide inserts in an interrupted cut, where the edge goes in and out of the material and the thermal shock between hot and cold cracks the coating: there air or consistent dry is better. Gray cast iron has always been machined dry, and aluminum works just as well on mist for plenty of jobs.

Where they are written in the program

The M08 goes after the positioning and the length offset, with the tool still up, and in its own block if the flow takes time to arrive. The M09 goes before the final retract and always before the tool change, along with the G80, the G40 and the M05 of the transition block. That order is not cosmetic: the M09 before going up to the reference point is what keeps cutting fluid out of the tool magazine. At the end of the program, write it even though the M30 might shut it off, because that depends on the machine.

What M08 does not control

The code is a switch and nothing else. It does not set flow or pressure, it does not aim the nozzles, it does not know how much fluid is left in the tank or what concentration it is at. It cannot beat the panel lockout either: if the operator has disabled the coolant at the machine, the whole program runs believing it is open. That is why, when a burned tool shows up in a run that was going well, the first thing to look at is level, concentration and where the nozzles are pointing, since they move when you change to a much longer or shorter tool.

Mistakes that cost you a part (or a tool)

  • Forgetting the M09 before the G28 and the tool change: the flood stays open while the axis goes up, waters the changer area and the fluid ends up inside the taper, which then slips in the spindle.
  • Drilling deep, reaming or tapping without opening the coolant: the chips do not come out, they pack down the hole and the tool breaks inside the part.
  • Counting on the M30 or the reset to shut the coolant: on many machines they do, but it is builder behavior and not a guarantee of the code.
  • Opening the M08 in the same block the tool enters the material: the pump takes time to build pressure and the first few millimeters are cut dry, just when the flow is most needed.
  • Pouring flood onto a ceramic insert or onto carbide milling in an interrupted cut: thermal shock cracks the edge long before it wears out.
  • Working with the tank low: the pump takes in air, the flow drops by half with nothing visible from outside and tools start lasting half as long.
  • Not checking where the nozzles are pointing after a change to a tool of very different length: the flood can be landing next to the cut.

Frequently Asked Questions (FAQ)

Can I put M08 in the same block as a move?

Yes, and it is what many post processors do, for example G00 Z2. M08. The one thing to know is that the exact instant the output switches on inside the block depends on the control. When you want to be sure the flood is on before the tool comes down, write it in its own block and add a short dwell.

Does M09 also turn off the M07 mist?

Yes. M09 is the general coolant off: it closes every output the builder has tied to that function, flood and mist included. There is no separate off code for each one in the standard.

Does the coolant shut off on its own at the end of the program?

Normally yes: M30, M02 and reset usually cut the coolant. But that is decided by the builder in the PLC and there are machines where it does not happen. Writing the M09 in the closing block costs nothing and works everywhere.

How do you switch on through-spindle or high pressure coolant?

With different codes: on Haas they are M88 to open and M89 to close, and every builder has its own. The internal circuit is what long drills with coolant holes need, and confusing it with the external flood leaves the tool without the flow that does the work.

Can you machine without coolant?

In plenty of cases yes, and sometimes it is better. Gray cast iron has always been machined dry, coated carbide milling in an interrupted cut prefers dry or air, and a lot of aluminum is worked on mist. What is not open to debate is deep drilling, reaming and tapping: there you need flow.

Related codes

Other codes in Machine

See the full list of G and M codes

Related tools