I am building a mpcnc with the autohome feature. However, when I try to autohome, the gantry moves up in the z axis (as expected) but then moves away from 0,0 in both the x and y direction for a few centimeters, then crashes the z axis into the spoilboard. I have attached images of my wiring.
Okay… I see the RAMPS in your photo, but nothing connected to E0/E1 which is going to make the endstops tricky.
With the endstops connected like that, you’ll need to be extgra careful to pair the right motor to the endstop. The basic switches mounted to the trucks (As provided for) is a better solution.
Auto homing will try to home all 3 axes. The behaviour that you describe would be if those switches are triggering positive (Backwards from the expected) where it reads the stops as triggered, backs off, then reads them as triggered again. You may have to invert the endstop logic in the firmware to use those switches. (Really, the NC switches on the trucks are better.)
You will need to connect a touchplate to home the Z axis.
In the V1 firmware, there should be a custom menu, which will have an itgem to home only X and Y, and leave Z for later, when you’re ready to use the touchplate probe.
I suspected that the wiring was off as you suggested. I looked into the firmware and saw that the logic for the endstops was not inverted for x and y, but it was inverted for the z axis. This explains why the z axis worked fine.
I just changed the logic in the firmware so that it had inverted x-y-z minimum logic. After reflashing with the new logic, autohome works perfectly.
I found it from the V1 firmware page, which is the first page that pops up for me if you search “mpcnc firmware”. Apparently, I didn’t notice the words “These are old versions of the V1 Firmware” at the top of the GitHub page.