Grbl hard limits

i’ve seen lots of complaints about hard limit switches on cnc machines. once they are tripped, they are a pain to get off the switch. the homing sequence hits a switch and backs off a bit. the homing sequence obviously knows which direction it’s going to get to home. i know there is only one pin per axis limit, but since the controller knows which way it’s going when it hits the other (non-homing) switch why couldn’t it execute the same back off routine, just in the opposite direction from the homing routine??? seems like that should be a simple change to grbl.

Grbl is extremely memory-constrained:

Once it goes into an error-condition (such as hitting a limit switch) it pretty much seems to need to be re-started to get to a known state.

A further consideration is it’s quite possible the machine is moving along 3 axes at once when a limit is hit.

I’m not in front of my machine, but if I recall correctly, I had this problem and I found there is a setting to make the limit switches not abort the job during homing.

That being said, if they trip during a job, then the job should be aborted.

I found my settings dump. Take a look at the soft/hard limit settings:

$0=10.0 ; Step pulse time, microseconds
$1=25 ; Step idle delay, milliseconds
$2=0 ; Step pulse invert, mask
$3=0 ; Step direction invert, mask
$4=0 ; Invert step enable pin, boolean
$5=0 ; Invert limit pins, boolean/mask
$6=1 ; Invert probe pin, boolean
$8=0 ; Ganged axes direction invert as bitfield
$9=1 ; PWM Spindle as bitfield where setting bit 0 enables the rest
$10=511 ; Status report options, mask
$11=0.010 ; Junction deviation, millimeters
$12=0.002 ; Arc tolerance, millimeters
$13=0 ; Report in inches, boolean
$14=0 ; Limit pins invert, mask
$15=0 ; Coolant pins invert, mask
$16=0 ; Spindle pins invert, mask
$17=0 ; Control pins pullup disable, mask
$18=0 ; Limit pins pullup disable, mask
$19=0 ; Probe pin pullup disable, boolean
$20=0 ; Soft limits enable, boolean
$21=1 ; Hard limits enable, boolean
$22=1 ; Homing cycle enable, boolean (Grbl) / mask (GrblHAL)
$23=3 ; Homing direction invert, mask
$24=25.0 ; Homing locate feed rate, mm/min
$25=3000.0 ; Homing search seek rate, mm/min
$26=25 ; Homing switch debounce delay, milliseconds
$27=2.500 ; Homing switch pull-off distance, millimeters
$28=0.100 ; G73 retract distance, in mm
$29=5.0 ; Step pulse delay (ms)
$30=11111.000 ; Maximum spindle speed, RPM
$31=0.000 ; Minimum spindle speed, RPM
$32=0 ; Laser-mode enable, boolean
$33=2500.0 ; Spindle PWM frequency
$34=0.0 ; Spindle off Value
$35=0.0 ; Spindle min value
$36=90.0 ; Spindle max value
$37=0 ; Stepper deenergize mask
$39=1 ; Enable printable realtime command characters, boolean
$40=0 ; Apply soft limits for jog commands, boolean
$43=1 ; Homing passes
$44=4 ; Homing cycle 1
$45=3 ; Homing cycle 2
$46=0 ; Homing cycle 3
$62=0 ; Sleep Enable
$63=2 ; Feed Hold Actions
$64=0 ; Force Init Alarm
$65=0 ; Require homing sequence to be executed at startup
$70=7 ; Network Services
$73=1 ; Wifi Mode
$74= ; Wifi network SSID
$75= ; Wifi network PSK
$100=26.667 ; X-axis steps per millimeter
$101=26.667 ; Y-axis steps per millimeter
$102=200.000 ; Z-axis steps per millimeter
$110=16000.000 ; X-axis maximum rate, mm/min
$111=16000.000 ; Y-axis maximum rate, mm/min
$112=500.000 ; Z-axis maximum rate, mm/min
$120=10.000 ; X-axis acceleration, mm/sec^2
$121=250.000 ; Y-axis acceleration, mm/sec^2
$122=10.000 ; Z-axis acceleration, mm/sec^2
$130=560.000 ; X-axis maximum travel, millimeters
$131=780.000 ; Y-axis maximum travel, millimeters
$132=120.000 ; Z-axis maximum travel, millimeters
$300=BB32GRBL ; Hostname
$302=192.168.5.1 ; IP Address
$303=192.168.5.1 ; Gateway
$304=255.255.255.0 ; Netmask
$305=23 ; Telnet Port
$306=80 ; HTTP Port
$307=81 ; Websocket Port
$341=0 ; Tool Change Mode
$342=30.0 ; Tool Change probing distance
$343=25.0 ; Tool Change Locate Feed rate
$344=200.0 ; Tool Change Search Seek rate
$345=200.0 ; Tool Change Probe Pull Off rate
$346=1 ; Restore position after M6 as boolean
$370=0 ; Invert I/O Port Inputs (mask)
$384=0 ; Disable G92 Persistence
$396=30 ; WebUI timeout in minutes
$397=0 ; WebUI auto report interval in milliseconds
$398=35 ; Planner buffer blocks
$481=0 ; Autoreport interval in ms