I have a simple 2-axis machine with limit switches at the most negative position. I’m stuck trying to get homing to work. I have the 3-wire switches shown in https://github.com/bdring/Grbl_Esp32/wiki/Setting-Up-Limit-Homing-Switch with the two wires connected (signal and ground). I’ve verified that the X and Y limit switches report Pn:X and Pn:Y when they are pressed, and don’t when they are released, and that they are connected to the correct axes.
When I try to home, each axis does the same thing: makes two small steps in the positive direction at the fast search rate for a distance of $27 then stops. No error is reported (unless the limit switch is already pressed, in which case it does ALARM: 8 ALARM: 3).
I’ve configured my machine with:
#define LIMIT_MASK B011
#define XLIMITPIN GPIONUM17
#define YLIMITPIN GPIONUM4
#ifdef HOMINGCYCLE0
#undef HOMINGCYCLE0
#endif
#define HOMINGCYCLE0 (1<
#undef HOMINGCYCLE1
#endif
#define HOMINGCYCLE1 (1<
#undef HOMINGCYCLE2
#endif
and runtime settings:
$3=0
$5=1
$20=0
$21=0
$22=1
$23=3
$24=200.000
$25=2000.000
$26=250
$27=1.000
all of which seem to make sense.
评论 (9)
#2 – dakoner 于 2020-06-05
The limit switches are clear when not pressed:
X limit switch pressed:
Y limit switch pressed:
Here’s what I see if I send $H then hit ? repeatedly:
Grbl 1.2a [‘$’ for help]
[MSG:’$H’|’$X’ to unlock]
$H
ok
ok
I’m pretty sure the system is working at the physical level, as I had this working with GRBL and a Nano previously.
#3 – bdring 于 2020-06-05
Strange, from your status reports, It looks like it did a successful home.
Are you able to jog the machine in both directions on each axis?
#4 – dakoner 于 2020-06-05
Yes, both axes jog fine in the Web UI. I also enabled software debounce, didn’t make any difference.
If I unplug the endstop signal wires from the ESP32, I don’t see Pn:X or Pn:Y, and homing runs until timeout.
I double checked the (normally open) switches and they seem to have an OK signal (I don’t have an oscilloscope to test, just a multimeter).
#5 – bdring 于 2020-06-05
Can you post your full machine definition file and the startup text?
#6 – bdring 于 2020-06-05
You could also try turning hard limits on. Then try jogging around. It will alarm if a limit is detected due to noise.
#7 – dakoner 于 2020-06-05
I tried enabling hard limits and that immediately reports:
Hard limit has been triggered. Machine position is likely lost due to sudden halt. Re-homing is highly recommended.
I assume this means that the pins are flickering constantly, faster than the once-per-second status reporting. Let me do some more basic testing.
#8 – bdring 于 2020-06-05
I am going to close this issue and give you a link to our slack.
#9 – MitchBradley 于 2020-06-05
Unless you have external pullups and RC filtering on your limit switches, your limits are going to be subject to a lot of noise pickup. The built-in pullup resistors on ESP32 GPIOs, even on the pins that have them, are quite weak (high resistance, and poorly controlled resistance), so they are not much use in the face of the kinds of noise that is common in machine environments. It is best to have external pullups in the 5K to 10K range, with signal-to-ground capacitance of about 0.1 uF. Also, each limit switch should have its own twisted pair wire with one side connected to GND at the controller board and the other side being the signal. Don’t share a single external GND wire with multiple switches, and do not let there be physical separation between the GND and the signal wire (hence twisted pair). And do not connect the limit switch to GND at the switch end. The GND connection must be at the controller end.
#1 – bdring 于 2020-06-05
Appears a limit switch is reporting as touched and won’t clear. Send a ? Command and post the response