GRBL mode¶
GRBL mode turns the machine into a standard Grbl-speaking laser cutter. This page tells you how to connect a sender, how the laser is armed and mapped, and what pausing, stopping, the lid, and the button do.
Read the Safety page first
ForgeFIRM is not the manufacturer's firmware. Read Safety before you run a job.
GRBL mode is the default mode and the one to use for your own designs (Modes). How the controller turns G-code into the pulse stream, and the state machine behind the behavior on this page, are in The grblHAL driver.
Connecting¶
The controller speaks Grbl 1.1 over TCP port 23. Point LightBurn, UGS, cncjs, or any Grbl sender at the machine's address on port 23. Setup details and a first job are in LightBurn.
Only one sender at a time is meaningful. Opening a second connection displaces the first. That is also why the web panel reads position from the machine's own counters and never from the Grbl socket.
A TCP disconnect never stops the controller process. A disconnect during a
laser job holds the job where the cut stopped (see the table below); a
motion-only job continues to its end. On connect the console shows the
controller's banner. Jog from a sender's console with a standard jog command,
for example $J=G91X40F1200.
Running the controller by hand
Under ForgeFIRM the controller grblHAL_glowforge is a supervised child
of forgectrl, which hands it the pulse device. You do not start it
yourself. For bench or debug work it can run standalone, once the
supervisor has released the device (POST /controller/stop):
Environment: GFSINK (the pulse device; unset = null-sink test mode),
GFSINK_RATE (a machine tick override; the default is the microstep
mode's, 28160 Hz at 8, the factory's own travel-move tick, doubled at 16
and quadrupled at 32; accepted 1000 to 165000), GFSINK_DEPTH_MS (the queue
depth, default 200; at least 20 and no more than half the stream ring at
the chosen rate). An out-of-range value is reported and the default is
used. Standalone, the driver opens the device itself and every takeover
runs a deliberate rail-off settle (rail_settle_s).
Laser mapping and power¶
$32(laser mode) is on by default, soM3/M4andSbehave the way senders expect.M4gives dynamic power scaled with speed through acceleration ramps;M3gives constant power.$30is 1000, and S values map onto the laser drive withS1000= full power. Set your sender's S-value maximum to 1000.- A power change lands at exactly the point along the path where it was planned, whatever else the machine is doing.
- An S value commands a fraction of the light, not a fraction of the pulses: the controller maps it through a measured dose curve onto the pulse density that delivers it. Every power level marks, low levels included. LightBurn, Power explains the model as you meet it, and Settings lists the laser keys.
$35, the power floor, is derived from thelaser_floor_densitysetting at every job. Do not type it; the controller overwrites it.- A change to a spindle
$setting takes effect when the controller restarts (a mode switch away and back, or a reboot).$$reports the new value at once, but the mapping in force stays the one loaded at start.
Fire only ever rides motion segments of laser blocks. Rapids and homing are fire-free by construction, not by convention, and a jog is always shipped dark, even with the laser on and the button pressed: the Move panel never fires.
Arming: the button press is part of every job¶
The first laser-on of a job does not fire. Instead the machine checks that it is fit to cut, and then waits for you:
- Is the cooling healthy? If the coolant is not proven to be moving, or is too warm or too cold, the machine refuses to arm and says so (Cooling and fans).
- Is the print head there? No head, no arming: the lens, the air assist and the beam sensor all live on it.
- The fans go to the cut profile, so every moment the beam can fire is covered by running fans and an active coolant check.
- The button lights white and the job waits for your press. Your sender keeps getting status reports, so it will not time out.
The mechanism behind each step is on The grblHAL driver.
A press with the lid open does not arm the machine, and neither would the
hardware latch clear on it. A soft reset, or opening the lid or the interlock,
cancels the job instead. If nobody presses within laser_button_timeout_s
(300 s by default), the job ends in alarm 3 with the laser locked again. The
cooling is checked once more after your press, so the window can never
open against a fault that appeared while the machine was waiting.
One press covers one job, not one cut. The window survives S changes
and M5/M3 toggles, so nothing asks you again in the middle of a job. It
closes, and the laser locks again, when:
- the job ends (
M2,M30,%), the normal case; - your sender disconnects or a different one connects, because the consent you gave belonged to that session;
- the laser has been off and idle for
laser_disarm_s(60 s by default), which keeps counting while a job sits paused and while you jog: a jog is not the job you consented to, and never keeps the window open; - the cooling engine's fail tier (
FIRE,CRASH,AIRFLOW,CRITICAL): the job ends with alarm 3 and the laser locked; - anything goes wrong: an alarm, a homing cycle, a reset, or a stream fault.
The next job asks for a fresh press. That is the same press the machine's own hardware latch needs, which is why the software and the hardware can never disagree about whether the machine is armed.
Pausing, stopping, and faults¶
| You do | What happens |
|---|---|
Feed hold (!) |
Controlled ramp to a stop, position kept. The ramp runs lit (velocity-scaled under M4), the stop is dark, and the disarm grace keeps counting. |
Cycle start (~) |
Resumes from the hold, lit from the first step: a pause is a sharp corner in time, and the corner rolloff governs its mark. If the grace closed the window during the pause, the button lights first and your press resumes the job. Under a standing pause-tier verdict the resume moves dark and is held again within a second, and the console says why. |
| Your sender disconnects mid-job | A laser job is held where the cut stopped and the window closes. The next sender finds it in Hold: ~ lights the button and a press resumes it, or ^X ends it. A motion-only job continues to its end. |
Jog cancel (0x85) |
Controlled stop, jog abandoned, position kept. |
Soft reset (^X) |
The laser locks and the machine slows to a stop. The position stays true. The machine is in Alarm: $X clears it. If the console says that the position cannot be read back, home before you trust the coordinates (Homing). |
| Press the button mid-job | Pause; press again to resume (below). |
| Open the lid or the interlock loop | The job is canceled, not paused (below). |
| Ring runs dry (underrun) | Motion stops instantly. Under a playing stream it is a fault, armed or not: alarm, latch relocked, position invalidated; re-home before trusting coordinates. Outside the armed window, an underrun as motion starts raises no alarm and the job goes on, but the position is invalidated all the same: re-home before trusting coordinates (Homing). |
Cooling verdict, pause tier (OVERTEMP, COLD, WARMUP, SENSOR, FLAME, BUMP, or a verdict gone stale) |
Feed hold with the cut airflow on; the deceleration runs lit and the stop is dark. When the verdict clears, the job resumes on its own. If the grace closed the window during the pause, the button lights first and your press resumes the job. |
Cooling verdict, fail tier (FIRE, CRASH, AIRFLOW, CRITICAL) |
The job ends with alarm 3 and the laser locked; nothing resumes it. Resolve the verdict, $X, start again (Cooling and fans). |
A move past the bed, after $H |
Alarm 2 before any motion for a program move, error 15 for a jog: after a home the bed is the limit (Homing). |
| Controller crash or hang | The daemon stops motion and relocks the latch, then restarts the controller. |
The controller clamps any feed faster than its limits: travels run up to
200 mm/s ($110/$111 = 12000 mm/min).
The crumb tray: M103¶
You can remove the crumb tray when your work is too tall to fit on it.
M103 P1 sets the tray out and M103 P0 sets it back in. With the tray out, Z is
automatically adjusted to the focal height above the floor of the machine instead of above the tray.
The console answers [MSG:Tray out] or [MSG:Tray in], even when the mode
was already set, so jobs you normally run without the tray can run this command
at every start. The machine remembers the mode through restarts, and the control
panel's Lens card shows it and switches its state (The control panel).
The distance to the floor is the tray_offset_mm setting (Settings),
and the details are in The grblHAL driver.
M-codes an extension answers¶
M160 to M179 belong to extension packages. When a package you installed
answers one, a job may name it, as M160 P1, and the job waits there, the
head still and the laser dark, until the package answers: the console shows
[MSG:M160 waits for its extension] and then [MSG:M160: done]. When the
package says it could not do its part, or does not answer in 30 s, the job
is held with a message that says why: resume it to go on without what the
M-code was for, or stop it. A job that names one no package answers stops
at that line with error:20, as for any unsupported command. See
Extensions.
Lid, interlock, and button¶
ForgeFIRM reproduces the factory machine's behavior:
- A lid or interlock open during a job cancels it. Motion stops within milliseconds of the switch edge, the job is not resumable, the latch relocks, and the head returns to the position the job started from, with the lid still open, exactly as the factory does. The return-home move always runs to completion.
- The button pauses and resumes. In GRBL mode a press is a feed hold and the next press is a cycle start. A pause is not a cancel: the armed window stays open across it. A pause longer than the disarm grace closes the window; the next press then lights the button and re-arms before the job resumes.
- Idle lid cycles are ignored. Opening the lid to load material, or powering up with it open, does not leave the controller parked. Senders connect normally.
- Jogs are not lid-gated. A jog both starts and runs with the lid open; the beam is blocked in hardware regardless.
- Homing needs the lid closed. With
homing_mode = gfcloudthe cycle is a cloud homing session, and its move to the home corner is an ordinary motion action: refused with the lid open, and stopped if the lid opens partway through. The camera steps need the lid closed anyway. Only the lens hunt inside that session ignores the lid (Homing).
If you prefer stock Grbl door behavior, set lid_policy = hold (the GRBL
tab): the job parks in the Door state, and a cycle start after the lid closes
finishes the move with its position intact. The button still has to be pressed
before the beam can return.
Homing, and running unhomed¶
The homing method is a setting, homing_mode, chosen in the web panel:
gfcloud (camera homing through the Glowforge service), switches (the
planned limit-switch cycle, not available), or none ($H is rejected).
Homing has the procedure.
The machine cuts fine unhomed. Without a reference, coordinates are relative to wherever the head happened to be, so the panel shows position in red to say so, and your sender should use a job-start mode that does not depend on machine coordinates (LightBurn, Job start mode). After a successful home the position is anchored and shown normally.
Anything that invalidates position drops the reference deliberately, so a stale origin can never be reused (Homing).
Fans¶
In GRBL mode the cut fan profile follows your sender's M8/M9 (LightBurn's
per-layer Air Assist), OR'd with the armed window: while the laser is armed the
fans run the cut profile whatever the sender says
(Cooling and fans).