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
Addresses
| Address | What it does |
|---|---|
P | Amount of speed change as a percent of programmed speed |
E | Time for one variation cycle in seconds |
How it works
Modal, until M139.
Example program
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
- Useful on long tools and thin walls that chatter at one speed.
- Spindle speed variation is meant for steady cutting, not tapping.
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
Addresses
| Address | What it does |
|---|---|
P | Speed variation in RPM |
E | Variation cycle time in seconds |
How it works
Modal until M139, M30, RESET or E-stop.
Example program
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
- M138 stays active even when the spindle is stopped.
- Turn it off before threading.
Related codes
M138 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Doosan (Fanuc) | Roof shower coolant on |
| Okuma OSP | Touch 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