Disable Limit Switches on CNC and Laser with GRBL

On lightweight home CNC and diode lasers, limit switches are often the main cause of errors and malfunctions. Vibrations, dust, electrical interference, and cheap contacts generate false triggers that suddenly stop the machine during work.

With GRBL, physical limit switches are controlled by $21 (Hard limits). This guide shows you the correct configuration to permanently eliminate problems.

โš ๏ธ Warning: On heavy industrial machines, limit switches are essential for safety. On lightweight CNCs (<5kg) and lasers, the force is reduced, so disabling them is often safe.

1. Disable physical limit switches (Hard Limits)

Parameter $21 controls Hard Limits: if active, GRBL immediately stops the machine at the slightest electrical signal from limit switch pins. To disable:

Send from serial console (LaserGRBL, UGS, Candle):
$21=0

After this command, GRBL will completely ignore physical limit switches. No false trigger can stop the machine anymore.

2. Enable software limits (Soft Limits)

With hard limits disabled, you can still protect the machine from collisions using Soft Limits ($20). GRBL calculates position virtually and prevents commands outside the work area.

$20=1

Before enabling, set the work area correctly:

$130=300.0 (max X in mm)
$131=300.0 (max Y in mm)
$132=50.0  (max Z in mm, if present)
โœ… Recommended: $20=1 and $21=0 ideal combination for lightweight CNCs.

3. The $23 parameter (Homing direction invert)

The $23 parameter has nothing to do with limit switch sensitivity or disabling. It only defines the movement direction during the homing cycle.

  • $23=0 โ†’ homing toward X-, Y-, Z- (default)
  • $23=3 โ†’ homing toward X+, Y+

Leave the default value or change it only if the carriage moves in the wrong direction during homing.

GRBL parameters summary table

ParameterGRBL NameDisable valueEnable valueFunction
$20Soft limits01 (recommended)Software protection without physical sensors
$21Hard limits0 (recommended)1Protection with physical limit switches (sensitive to interference)
$22Homing cycle01Enables zero search at startup
$23Homing dir invert--Inverts homing direction (no effect on triggers)

Alternative: keep hard limits without false triggers

If you want to keep physical limit switches active ($21=1), reduce false triggers with:

  • Software debounce: $26=250 (250ms filter on bounces)
  • 100nF capacitor on limit switch pins to GND
  • Shielded cables and good grounding

Send $$ in the console to see all current parameters.

Quick troubleshooting checklist

  • โœ… First solution: $21=0 + $20=1
  • ๐Ÿ”Œ Check cables and connectors (oxidation, breaks)
  • ๐Ÿงน Clean limit switches from dust and debris
  • ๐Ÿ“ Mechanical alignment and tight fasteners
  • โšก Check electrical interference (motors, inverters)

Sources: Official GRBL configuration (gnea/grbl Wiki) and r/hobbycnc community.

Tip: For lightweight machines, disabling hard limits ($21=0) is often the fastest and most effective solution against false triggers.

โ† Back to all guides