- Added changelog section documenting all modifications since forking - Documented December 4, 2025 changes (inverted servo PWM, M5 fix) - Listed earlier modifications (servo mode, homing fix)
2.5 KiB
GRBL Homing Issue - Fix Documentation
Problem Identified
Your GRBL configuration was attempting to home X and Y axes simultaneously in HOMING_CYCLE_1. When axes home at the same time, whichever limit switch is encountered first can cause the entire homing cycle to abort, especially if:
- Axes have different distances to travel to their limit switches
- Mechanical tolerances cause one axis to reach its switch before the other
- The machine isn't perfectly square
Root Cause
In grbl/limits.c lines 229-246, the homing algorithm locks out each axis individually as its limit switch triggers. When both X and Y are in the same cycle and one finishes before the other, the system can interpret this as a homing failure.
Solution Applied
Changed in grbl/config.h:
Before:
#define HOMING_CYCLE_0 (1<<Z_AXIS) // Z axis first
#define HOMING_CYCLE_1 ((1<<X_AXIS)|(1<<Y_AXIS)) // X,Y together
After:
#define HOMING_CYCLE_0 (1<<Z_AXIS) // Z axis first
#define HOMING_CYCLE_1 (1<<X_AXIS) // X axis second
#define HOMING_CYCLE_2 (1<<Y_AXIS) // Y axis third
How This Fixes It
Now the homing sequence is:
- Cycle 0: Z-axis homes (clears workspace)
- Cycle 1: X-axis homes independently
- Cycle 2: Y-axis homes independently
Each axis completes its homing cycle before the next begins, eliminating the race condition.
Next Steps
-
Recompile GRBL with the new configuration:
cd /home/devdesk/yair/drawbot/grbl make clean make -
Upload to your Arduino/controller
-
Test the homing cycle:
- Connect to your GRBL controller
- Send
$Hcommand - Verify that Z homes first, then X, then Y sequentially
Alternative Configuration
If you prefer X and Y to home in reverse order:
#define HOMING_CYCLE_1 (1<<Y_AXIS) // Y first
#define HOMING_CYCLE_2 (1<<X_AXIS) // X second
Your Current Settings Reference
From your debug output:
$22 = 1- Homing cycle enabled ✓$23 = 6- Homing direction mask (binary: 00000110 = Y and Z inverted)$24 = 25.000- Homing feed rate$25 = 500.000- Homing seek rate$26 = 250- Homing debounce delay$27 = 1.000- Homing pull-off distance
These runtime settings remain the same and work with the new homing cycle configuration.
Performance Impact
Homing Time: Sequential homing takes slightly longer than simultaneous (~few seconds), but provides 100% reliability.
Safety: Better control over axis movement sequence.