Skip to content

M13 / M14: combined spindle and coolant functions

On many machines, M13 and M14 combine spindle start and coolant on in a single block, one for each direction of rotation, saving a line at every tool change. But the meaning isn't universal: on some lathes that pair is assigned to the spindle brake or the C axis, and on other machines it simply doesn't exist. It is a clear case of an M-code that looks standard because of its low number and in fact depends entirely on the machine builder's PLC.

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.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Auxiliary
Machine
Milling, Turning, Mill-turn
Risk
Medium
Example
M13 / M14

Syntax by control

Mill with combined functions
M13 S3000 / M14 S3000
Where they exist, one starts the spindle clockwise with coolant and the other counterclockwise with coolant. It is equivalent to writing spindle start and coolant in two blocks, except that here they happen at the same time.
Haas lathe
Possible brake or C-axis function
On Haas lathes, codes in that range may relate to the spindle brake or the C axis, not to coolant. It is exactly the kind of difference that forces you to look at the table before transplanting a program.
Safe, portable form
M03 S3000 ; M08
Writing spindle start and coolant separately works on any machine and makes it clear what is being commanded. That is what most post processors do, for good reason.
Verification
M-code list in the machine manual
As with all builder-specific M-codes, you confirm it in the auxiliary function list. Trying it in MDI with the machine empty also settles the question in a minute.

Address letters used with it

LetterWhat it setsUnit
M13Where it is implemented as a combined function, it starts the spindle in one direction and turns the coolant on. On other machines it may be a different function.no parameters
M14The equivalent function in the opposite direction, or a completely different function depending on the builder.no parameters
SSpindle speed, which goes with the M-code just as it would go with a normal start.rpm
M09Turns the coolant off. You need to know whether on your machine the combined M-code is canceled by the spindle stop or the coolant has to be turned off separately.no parameters

Worked example

Comparison between writing the combined start and doing it separately, at a normal tool change on a mill. The example shows both as alternatives, not as one continuous program, and explains why the separate version is the one recommended in a shop with several machines.

O1300 (ARRANQUE COMBINADO FRENTE A SEPARADO)
( Program header. )
(VERIFICAR M13/M14 EN LA TABLA DE ESTA MAQUINA)
( Mandatory warning before using a builder-specific M-code. )
G21 G17 G40 G49 G80
( Safety header. )
T2 M06
( Tool change. )
G90 G54 G00 X20. Y20.
( Positioning in the plane. )
G43 H02 Z50. M13 S4000
( Combined version: applies the length offset, starts the spindle at 4000 rpm and turns the coolant on in a single block. Saves one line per tool. )
G00 Z2.
( Approach to the face. )
G01 Z-4. F250
( Plunge into the material. )
G01 X120. F800
( Cutting pass. )
G00 Z50. M09
( Retract and coolant off. Here is the catch: on some machines coolant turned on with the combined M-code shuts off with a normal M09, and on others it shuts off when the spindle stops. )
G91 G28 Z0. M05
( Z to the reference point and spindle stop. )
(VERSION SEPARADA Y PORTABLE)
( An alternative to the above, not a continuation of it: the same operation written the way that works on any machine. )
G90 G43 H02 Z50. M03 S4000
( Length offset and spindle start, not combined. The G90 keeps the G91 from the previous block from staying active. )
M08
( Coolant in its own block. Two lines instead of one, in exchange for a program that is readable and transferable. )
G90 M30
( End of program. )
Open the simulator to check the example

Practical keys to using M13/M14 in the workshop

What you gain and what you lose by combining

What you gain is one line per tool change and a more compact program to read. What you lose is portability and clarity. A combined M-code doesn't say in the code itself that it is turning the coolant on, so whoever reads the program has to know that or look it up. And if the program moves to another machine, that same number may not exist or may do something else. In a shop with a single machine and a stable template, the convenience can be worth it; as soon as there are several machines or the program is shared, writing them separately pays off far better.

The specific risk: coolant left on

The practical problem with combined functions is the asymmetry. It is easy to remember that M13 turns the coolant on at start; what isn't always clear is what turns it off. On some machines stopping the spindle is enough, on others you need an explicit M09, and on others the coolant stays on until the end of the program. Coolant left on during a tool change sprays the magazine, wets the tool tapers and carries chips into the changer. That is why you should check the shutoff behavior just as you check the turn-on behavior.

The case of lathes, where the number means something else

On some lathes, codes in this range are assigned to the spindle brake or to C-axis functions, not to coolant. A mill program moved over without review can end up activating a brake where coolant was expected, with consequences ranging from a scare to mechanical damage. That is why a mixed lathe and mill shop should keep the M-code tables for its machines within reach and always comment builder-specific codes in the program headers.

Mistakes that cost you a part (or a tool)

  • Moving a program with M13 to another machine without checking the table: the same number may actuate a brake or not exist at all.
  • Assuming that coolant turned on with the combined M-code shuts off by itself when the spindle stops.
  • Writing combined M-codes in programs that are going to be shared among several machines in the shop.
  • Not commenting in the program what the combined M-code does, leaving whoever reads it unaware that the coolant is being turned on.
  • Assuming that a low M-code number means it is standard: beyond the basics, everything is builder-specific.
  • Using the combined M-code on a tool that shouldn't get coolant, as in some cast iron or plastics machining.

Frequently asked questions

Is M13 standard?

No. Only the basic M-codes, such as spindle start and stop, coolant and end of program, behave the same on almost every machine. M13 and M14 are functions each builder assigns in its PLC, and although the spindle and coolant combination is the most common, it is not guaranteed.

How do I shut off the coolant that M13 turned on?

It depends on the machine. On many, M09 shuts it off just as if M08 had turned it on; on others it shuts off when the spindle stops. The way to settle it is to try it with nothing in the machine: start with the combined M-code, command M09 and see if the stream stops.

Are they worth using?

If you always work on the same machine and the program never leaves it, they save a line per tool and no harm done. If the shop has several machines or programs are shared, writing spindle start and coolant separately avoids problems and costs practically nothing.

What do they do on a lathe?

It depends on the lathe. On some lathes those numbers relate to the spindle brake or the C axis, not to coolant. It is a clear case of why a builder-specific M-code is never assumed: you look it up in the auxiliary function list for that specific machine.

What does my post processor do?

Most post processors write spindle start and coolant separately, precisely for portability. If yours outputs combined functions, it is because someone configured it for that machine, and that detail has to be remembered the day the same post is used for another one.

Related codes

M03/M04/M05M08/M09M07M19DMG Mori M-codes

Other codes in Auxiliary

See the full list of G and M codes

Related apps