Homing CNC machine

Hello everyone.
I’ve been trying to set the homing point for Chinese CNC machine, I’ve changed their original board to CNC shield V3 connected with Arduino Uno. I use Universal G-code Sender combine with Arduino code from GitHub for this project. Here are the problems I’ve approved.

  1. The first problem I approached as I manually control the machine to activate limit switches I found that limit would be activated when it get released instead of when it get pressed
  2. Second problem is when I clicked homing, machine moved only Z Axis, and I left it doing that to see if it will move XY plane after Z axis moves up till it reaches either the limit switch or the upper base and stop. But it isn’t.

Thank you in advance.
P.S. currently I trying to check the code on config.h to figure out where to fix but still have no Idea.

Which firmware are you using? I believe marlin can still run on the uno/shield, but grbl is another popular choice.

In either event, it sounds like your switches are not wired the way the firmware expects: either the switches are normally open and the firmware is looking for normally closed or vice versa.

The fix is to either wire the switches the other way or to invert the switches in the firmware. Changing the wiring is straightforward, but more work. If Marlin, inverting the switches must be done in the config, then compiled and flashed. If GRBL, it can be changed same as Marlin OR through a console via the $$ settings.

In choosing whether to rewire the switches, consider that Normally Closed is largely preferred because a failed (or unplugged) switch will usually show open and trigger an error immediately, while a normally open switch will appear to be OK until it crashes while homing.

1 Like

What version of grbl are you using? The CNC Shield v3.00 was designed for an older grbl version, I believe 0.9f or earlier. The big change between that older version and the current version of grbl is the remapping of the pins to allow PWM control of the spindle. This means the silkscreen on the V3.00 shield has the Z endstops (while there are 2 physical pins on the shield they map to a single Arduino pin) and the SpinEn pins swapped. Plug your Z end stop to SpinEn and the spindle control (if you’re using it) to either of the Z end pins.

These two links should get you just about everything else you need to know to get your configuration working.
Grbl Commands
Grbl Configuration

For tweaking normally open vs normally closed end stop switches, check theLimit Pins Invert, boolean section.

Use the $ command to check the state of the switches.

1 Like

Sorry for late reply, It seems like your assumption is true, I’ve been looking for further infomations, it’s related to what you’ve said, Thank you.