Constant Power vs Dynamic Power (M3 vs M4) in GRBL Lasers: What It Actually Changes
Buried in nearly every GRBL laser's settings is a single G-code command choice — M3 or M4 — that a lot of people never touch because their software picked one by default and everything seemed to work. It's not a cosmetic setting. Getting it wrong is one of the most common causes of inconsistent engraving depth, dark leading edges, or blown-out corners on the Ray5 20W and every other GRBL-based diode or CO2 laser, and it's rarely mentioned in troubleshooting guides that instead point at focus height or air assist. This covers what the two modes actually do and when each one is correct.
The Core Difference
M3 and M4 are both "turn the laser on" G-code commands, but they control power differently relative to the machine's motion:
ModeBehaviorAlso CalledM3 — Constant PowerLaser fires at commanded power continuously, regardless of how fast the head is actually moving at that instantConstant power mode, laser-onM4 — Dynamic Power (Laser Mode)Laser power is automatically scaled down when the head decelerates or is moving slower than the programmed feed rate — e.g., through corners and direction changesDynamic power mode, laser mode, S-value scalingThe mechanical reality driving this: GRBL's motion planner has to slow the head down through sharp corners and at the start/end of vector segments — it physically can't instantly snap from one feed rate to another. If the laser fires at full commanded power the whole time, any point where the head is moving slower than programmed gets more energy deposited per unit distance, because dwell time in one spot goes up when speed goes down. That shows up as scorched corners, dark dots at direction changes, and overly deep engraving right where the head starts and stops.
Why M4 Exists
M4 (dynamic/laser power mode) has GRBL scale the S-value (power) in real time based on actual instantaneous velocity versus programmed feed rate. When the head slows into a corner, power scales down proportionally, so the energy deposited per unit distance stays consistent whether the head is at full speed on a straight run or crawling through a tight radius. This is the setting responsible for clean, even corners on detailed vector cuts and consistent grayscale on raster engraves — without it, GRBL-based lasers running complex vector art reliably show darker or more deeply cut corners than straight segments.
When to Use Each
- M4 (dynamic power) — the correct default for nearly everything: vector cutting with corners and curves, detailed engraving, any job where consistent energy density across the whole path matters. This is what LightBurn and most laser software default to for a reason, and what should be running for the vast majority of Ray5 and other diode laser jobs.
- M3 (constant power) — narrow, specific cases: certain raster engraving modes where the firmware or software already handles power modulation per-pixel independently of motion speed, some CO2 tube setups where the tube's own response characteristics make M4's rapid power scaling less predictable, and diagnostic/calibration situations where you deliberately want fixed power regardless of speed (like building a speed/power test grid where you want the power axis isolated from motion effects).
Where This Setting Lives
Most laser software (LightBurn, LaserGRBL, LaserBurn) sets M3 or M4 automatically per operation type and mode — LightBurn in particular defaults to M4 for standard cut/fill operations and this is rarely something to override without a specific reason. Where it actually bites people is hand-written or generated G-code from other sources (custom scripts, some CAM exports, older tutorials copied from CO2 laser communities where M3 conventions are more common) that hard-code M3 without the user realizing it. If corners are consistently darker or deeper than straights on an otherwise well-calibrated machine, check which mode the G-code is actually using before touching speed, power, or focus settings.
A Quick Diagnostic Test
Cut a simple test pattern with a tight zigzag or a small circle at a moderate speed and power, once with M3 and once with M4, on scrap material of the same batch. Under M3, corners and the zigzag's direction-change points will show visibly darker or deeper marks than the straight runs. Under M4, the pattern should look far more uniform end to end. This is a fast way to confirm which mode your software is actually emitting, independent of whatever the settings dialog claims.
GRBL Firmware Requirement
M4's dynamic power scaling requires GRBL to be built with laser mode enabled ($32=1 in GRBL settings) — without it, M4 behaves like M3 and the dynamic scaling doesn't happen. This setting is virtually always enabled by default on purpose-built diode laser controllers like the ones shipped with the Ray5, but is worth double-checking on any GRBL board originally intended for a CNC spindle that's been repurposed with a laser module.
It's a one-line setting with an outsized effect on cut and engrave quality, and unlike focus height or air assist it's invisible in the final result until you know exactly what artifact to look for. Once corners and detail work start coming out even, it's one less variable to chase the next time a job looks slightly off.
Related Guides
- How to Optimize GRBL Firmware on the Longer Ray5 20W
- Longer Ray5 20W — Machine Reference & Connection Guide
- LightBurn Complete Guide: Interface, Layers, and Workflow
- Longer Ray5 20W Complete Setup Guide: Assembly, LightBurn, Focus, and First Engrave
- Mounting a Diode Laser Module on Your CNC Router: Dual-Use Gantry Conversion
- Laser-Ablating Copper for Chemical-Free PCB Prototyping
- How to Use LaserBurn: Complete Guide to Longer's Laser Software
- How to Use LaserGRBL: Free Laser Control Software for GRBL Engravers