M41–M44

Machining center, Lathe

Switching the spindle gear (speed range)

Format and notes

M41–M44 (how many ranges there are and which is the low-speed one depends on the machine)

Example

T0101 M41 ;        (low-speed gear. On the same line as the tool call)
G97 S300 M03 ;     (set the gear before starting the spindle)

An example written by Kezuriba following the style of the MHLW NC lathe training material.

Most M codes are assigned by the machine builder (the Siemens ISO dialect manual leaves M00–M89 to the machine tool maker). The same number can mean different things on different machines, so always check your machine’s manual.

Diagram: M41–M44: speed range of each gear (schematic)

Spindle speed →Low gear2nd gear3rd gearHigh gearHigh torque (heavy cuts, large stock)High speedOverlap: either gear can run this speedBands, ranges and code order depend on parameters and the machine builder
Each gear has its own usable speed range, and the lower the gear, the more torque it gives at low speed. Most CNCs choose the gear automatically from the S value; M41 and the others are for forcing a particular gear. An S outside the range gives an alarm or an automatic gear change. The values differ by machine, so none are shown.

Differences between controls and machines

The same code can be written or assigned differently depending on the CNC control and the machine builder. Always check your machine’s manual.

SourceMachineItemDetail
MHLW (Japan) training textLatheMeaningM41–M44 gear range (speed range setting)
HaasMachining centerMeaningM41 fixes low speed and M42 fixes high speed (override). Returns to normal at the next S command. Write it together with S, before M03
HaasLatheMeaningM41 and M42 are gears (an option on machines with gears)
HaasLatheMeaningM43 and M44 unclamp and clamp the turret (for maintenance). They are not gears
Siemens (native)—MeaningM40 selects automatically; M41–M45 are gear ranges 1–5
Beckhoff—MeaningM40–M45 are gear ranges 1–6 (M40 is range 1). You don't need to write them if automatic selection is ON
Mitsubishi ElectricLatheNotesIf speed ranges of up to 4 are set in parameters, the gear signal is output automatically from the S value
Siemens (ISO dialect)—NotesM40–M45 are M-codes with fixed meanings, and cannot be replaced by subprogram calls or the like

Sources

The meaning of this code agrees in two or more sources from different publishers. Explanations are written in our own words.

  1. Ministry of Health, Labour and Welfare (MHLW), Human Resources Development Bureau, Office of the Councillor for Skills Evaluation — Human resource development manual using the practical exam tasks of the Grade 3 Skilled Worker Test: CNC lathe work (March 2018) waza.mhlw.go.jp
  2. Haas Automation, Inc. — M41 / M42 Low / High Gear Override (machining center, per-code explanation page) haascnc.com
  3. Haas Automation, Inc. — M41 / M42 Low / High Gear (lathe, per-code explanation page) haascnc.com
  4. Haas Automation, Inc. — Lathe Operator's Manual – 17 Lathe M-Codes (online version) haascnc.com
  5. Siemens AG — SINUMERIK 840D sl/840D/840Di sl/810D Fundamentals, Programming Manual, Edition 08/2005 (6FC5398-1BP10-0BA0) cache.industry.siemens.com
  6. Beckhoff Automation — TwinCAT CNC Programmierung: Getriebeschalten von Spindeln (M40 - M45) (in German) infosys.beckhoff.com
  7. Mitsubishi Electric — MITSUBISHI CNC 700/70 Series Programming Manual (Lathe System) (IB-1500057) mitsubishielectric.com
  8. Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Milling, 04.2007 Edition (6FC5398-7BP10-0BA0) cache.industry.siemens.com