CNC Machinist Calculator Ultra

Home › M-codes › Haas NGC › M138

M138 Spindle speed variation on / Spindle speed variation on, programmable

Haas NGC M-code · Mill, Lathe

On mills: Spindle speed variation on

Varies the spindle speed up and down around the programmed speed to break up chatter.

Verify on your machine. This entry could not be fully checked against the maker manual. Check your machine manual before you run it.

Format

M138 P E

Addresses

AddressWhat it does
PAmount of speed change as a percent of programmed speed
ETime for one variation cycle in seconds

How it works

Modal, until M139.

Example program

S3000 M03 (SPINDLE ON)
M138 P5 E1. (VARY SPEED 5 PERCENT EACH 1 SECOND)
M98 P1013 (CUT THE WALL)
M139 (VARIATION OFF)

Example is in inch. Check offsets and clearances first.

Watch out for

On lathes: Spindle speed variation on, programmable

Turns on spindle speed variation. P sets the RPM swing and E the cycle time in seconds, overriding Settings 165 and 166.

Format

M138 [P] [E]

Addresses

AddressWhat it does
PSpeed variation in RPM
EVariation cycle time in seconds

How it works

Modal until M139, M30, RESET or E-stop.

Example program

G97 S1200 M03 (1200 RPM)
M138 P100 E1. (VARY 100 RPM EVERY 1 SECOND)
G01 Z-3. F.008 (TURN)
M139 (VARIATION OFF)

Example is in inch. Check offsets and clearances first.

Watch out for

Related codes

M139 · M03 · M38

M138 on other controls

The same number can mean something different on another control.

ControlMeaning
Doosan (Fanuc)Roof shower coolant on
Okuma OSPTouch setter interlock release OFF
Heidenhain TNC (ISO)Select tilting axes

Every M-code for Haas NGC in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.

Open M138 in the app All Haas NGC M-codes

App Store Google Play