Homing machine in Universal GCode Sender

Hello all,
I have made my own desktop CNC machine, with grbl controller, and using the universal gcode sender.

while setting it up using the setup wizard, I was confused to configure the limit switches, I have 2 for X-axis (X+ and X-), 2 for Y-axis(Y+ and Y-), and 1 for Z-axis (Z+), I dont know how to configure them to home my machine.

this is my firmware setting:

$0 10 Step pulse time
$1 25 Step idle delay
$2 0 Step pulse invert
$3 3 Step direction invert
$4 0 Invert step enable pin
$5 0 Invert limit pins
$6 0 Invert probe pin
$10 1 Status report options
$11 0.010 Junction deviation
$12 0.002 Arc tolerance
$13 0 Report in inches
$20 0 Soft limits enable
$21 0 Hard limits enable
$22 1 Homing cycle enable
$23 3 Homing direction invert
$24 25.000 Homing locate feed rate
$25 100.000 Homing search seek rate
$26 25 Homing switch debounce delay
$27 1.000 Homing switch pull-off distance
$30 1000 Maximum spindle speed
$31 0 Minimum spindle speed
$32 0 Laser-mode enable
$100 100.000 X-axis travel resolution
$101 100.000 Y-axis travel resolution
$102 100.000 Z-axis travel resolution
$110 100.000 X-axis maximum rate
$111 100.000 Y-axis maximum rate
$112 100.000 Z-axis maximum rate
$120 10.000 X-axis acceleration
$121 10.000 Y-axis acceleration
$122 10.000 Z-axis acceleration
$130 200.000 X-axis maximum travel
$131 10.000 Y-axis maximum travel
$132 10.000 Z-axis maximum travel

I dont know what to change, or either by changing the settings or from the hardware

Are you wiring the +/-axis limit switches in Series? grbl assumes that if it's moving +X and Xlimit trips, it's hit Xmax, and if moving -X and Xlimit trips, it's hit Xmin, so it's expected to double up the the X+ and X- switches on the Xlimit pin.

image
(ht Protoneer: https://blog.protoneer.co.nz/arduino-cnc-shield/#BoardLayout)

1 Like

I connected the NC terminals of the limit switches to the CNC shield.
for example for x-axis:
1 NC to the positive pin on the shield and the other to the negative

what is happening is when I press "home machine", it is going up through the z-axis, for a specific distance and an alarm is triggered

The default grbl+shield setup is for normally open switches in parallel. It is better to use NC in series, so it fails-safe, but then you need to invert the limit pins ($5) and wire the switches in series.

If you invert the limit pins and leave the NC switches connected in parallel, one or the other of the limit switches will be closed and always will inhibit detection of the other limit by shorting Limit ?-Axis.

do u recommend changing the limit switch pin connections from NC to NO? May this be the issue?

You can do it either way:

...but the wiring and $5 settings depend on the type of switch.

I prefer the NC in series form so that if a wire or switch breaks or becomes unplugged, it acts as if it hit a limit switch.

I am using the ME-8111 limit switch, how i find the com?
It has 4 terminals as follows:

3 NO | 4 NO

1 NC | 2 NC

In my project i took a wire from terminal 1 to the positive side of the X+, and the terminal 2 to the negative side of the X+ limit switch.

If you wired 1&3 together, they would act like COM on a 3-terminal switch. In an NC context, is as if (1NC) is (COM).

But you could just do:

(X-)----(SW1 1NC)----(SW1 2NC)----(SW2 1NC)----(SW2 2NC)---(X+)
(X+)----(SW1 1NC)----(SW1 2NC)----(SW2 1NC)----(SW2 2NC)---(GND)
or
(X-)----(SW1 1NC)----(SW1 2NC)----(SW2 1NC)----(SW2 2NC)---(GND)
or
(GND)----(SW1 1NC)----(SW1 2NC)----(SW2 1NC)----(SW2 2NC)---(X+)
or
(GND)----(SW1 1NC)----(SW1 2NC)----(SW2 1NC)----(SW2 2NC)---(X)

as in


(ht Wiring Limit Switches · gnea/grbl Wiki · GitHub)

okay i will try, probably its wiring issue.

on the cnc shield, I have:
For X+ 2 pins white and black
For X- 2 pins white and black

I should use 1 of them and doesnt matter which one to use or how?

It does not matter which of the +/- pairs you use. For each axis, the pins on the endstop headers are connected together on the CNC shield before they hook into the 3 Uno pins:


per Arduino CNC Shield – 100% GRBL Compatable | Protoneer.co.nz

One column is grounds, and the other column is signals:

That is:
image

Z+ is connected internally to Z- in its silkscreened box. As is Y+ to Y-. And X+ to X-. So you need Z+ and its ground. I'll edit my wrong line above to:

(X+)---(SW1 1NC)---(SW1 2NC)---(SW2 1NC)---(SW2 2NC)---(GND)

the x and y axis are working properly, disconnected one i press the limit and connected when released.
however, the z axis still not working, the limit switch is normal and functional.
i connected directly the Z to the ground and the Z still didnt seem to be connected.
i tested the Z pins, the positive and negative pins of the Z are working as ground.
Is the CNC shield damaged? Or any recommended solution??

Do Z+ and Z- on the shield both connect to Pin 9 pin 11 on the Arduino?

Does your Arduino work with the Button example sketch configured for pin 9 pin 11 or pin 12?

Oh, depending the shield version/clone version/grbl version/grbl configuration, the Z-stop might be on a different pin, like SpindleEnable/pin 11/pin12:

Yes, this was the problem. I connected Z to the spindle pin it worked.

Thanks a lot​:raising_hand_man::raising_hand_man::raising_hand_man:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.