GRBL Homing Glitch...

Discussion about the arduino based g-code interpreter, grbl
Post Reply
Baxter
Posts: 24
Joined: Sun Dec 30, 2018 7:11 am

GRBL Homing Glitch...

Post by Baxter » Tue Feb 05, 2019 11:59 am

I'm a newby building an eShapeoko. I have the mechanics set up, and am driving them with an Arduino Uuo loaded with GRBL 1.1.

I made up my own limit switches, following the wiring diagram here: https://amberspyglass.co.uk/forum/viewt ... c373a20#p9 - which includes a Schmitt trigger circuit. Then I tried jogging the Z axis up and down to test the limits. That didn't work, until I set $21=1, upon which it worked perfectly. The only down side was that I had to close down G Code Sender and manually back off the Z axis to get a reset and continue - but this seems to be normal.

Then I thought I would try Homing. I set $22=1, and kicked off a $H. When this happened the Z axis drove fast in the +ve direction, not recognising the limit switch, and pushed the limit tag right off the end of the Z rail. I had to kill the power to stop the stepper.

I then manually reset the Z rail, restarted G Code Sender, and tried to restart the Arduino. But I got an immediate error. I checked the limit switches - all appeared to be working properly. But each time I restarted - even with a cold reboot - I got the same error. I removed the limit switch connections from the Arduino to eliminate any possible switch glitch, but I still got a hard error on booting.

Has anyone got any idea what may be causing it? My boot sequence (mainly default settings) is below:

**** Connected to COM4 @ 115200 baud ****
Grbl 1.1f ['$' for help]
>>> $$
$0 = 10 (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)
$6 = 0 (Invert probe pin, boolean)
$10 = 1 (Status report options, mask)
$11 = 0.010 (Junction deviation, millimeters)
$12 = 0.002 (Arc tolerance, millimeters)
$13 = 0 (Report in inches, boolean)
$20 = 0 (Soft limits enable, boolean)
$21 = 1 (Hard limits enable, boolean)
$22 = 1 (Homing cycle enable, boolean)
$23 = 0 (Homing direction invert, mask)
$24 = 25.000 (Homing locate feed rate, mm/min)
$25 = 500.000 (Homing search seek rate, mm/min)
$26 = 250 (Homing switch debounce delay, milliseconds)
$27 = 1.000 (Homing switch pull-off distance, millimeters)
$30 = 1000 (Maximum spindle speed, RPM)
$31 = 0 (Minimum spindle speed, RPM)
$32 = 0 (Laser-mode enable, boolean)
$100 = 250.000 (X-axis travel resolution, step/mm)
$101 = 250.000 (Y-axis travel resolution, step/mm)
$102 = 250.000 (Z-axis travel resolution, step/mm)
$110 = 500.000 (X-axis maximum rate, mm/min)
$111 = 500.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 = 10.000 (Y-axis acceleration, mm/sec^2)
$122 = 10.000 (Z-axis acceleration, mm/sec^2)
$130 = 200.000 (X-axis maximum travel, millimeters)
$131 = 200.000 (Y-axis maximum travel, millimeters)
$132 = 200.000 (Z-axis maximum travel, millimeters)
ok
>>> $G
[verbose]GrblFeedbackMessage{message='[GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0]', distanceMode='G90', units='G21'}
[GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0]
ok
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|WCO:1.448,0.000,21.466>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Ov:100,100,100>

Baxter
Posts: 24
Joined: Sun Dec 30, 2018 7:11 am

Re: GRBL Homing Glitch...

Post by Baxter » Tue Feb 05, 2019 1:01 pm

Aha - one issue sorted. Z and X axis limit switches wired up incorrectly - crossed over. That explains why the Z limit was not detected. But the machine still is in an error state, and will accept no commands.

It puts out the message '$ command cannot be used unless GRBL is in idle state'. And does this even after a cold reboot, and pressing the Arduino reset....

Baxter
Posts: 24
Joined: Sun Dec 30, 2018 7:11 am

Re: GRBL Homing Glitch...

Post by Baxter » Tue Feb 05, 2019 1:05 pm

...and now I think I see the problem. $X means 'Unlock'. Which needs to be done after an error, even if cold booted. Who would have thought it, eh?

One more issue solved...isn't learning fun... :D
Last edited by Baxter on Tue Feb 05, 2019 1:12 pm, edited 1 time in total.

Baxter
Posts: 24
Joined: Sun Dec 30, 2018 7:11 am

Re: GRBL Homing Glitch...

Post by Baxter » Tue Feb 05, 2019 1:11 pm

Hmmm.... STILL ignores the limit switch. But at least I know how to restart the machine now......

P.S. Now that I can restart the system I was able to sort out the limit switch wiring, and I got it to Home. Success!!

Post Reply