Setting Bounaries / Adding Limit Switches

I am excited to say that I have my MPCNC up and running!
I am trying to figure out how to keep the middle assembly from smashing into the sides of the machine- I am assuming this can only realy be done using limit switches for X/Y min/max, like on my 3D printer.
I have plenty of simple limit switches laying around the shop, but I have absolutely no idea how I am supposed to hook them up to the RAMPS board to tell the motor to stop. If anyone has some guidance on this (pictures are always helpful!) that would be fantastic. I may have missed a write up about this- if so, I would love to see it!
Thanks a lot!

It’s fairly simple. Just wire the switches in the normally open configuration, and connect them to the end stop connections on the board. I have a post around here somewhere showing off my z touch plate, it shows where to plug them in.

@Barry , I’ve looked for the specifics on how to wire a z touch plate and can find lots of discussion but no directions on how to wire it up to the RAMPS 1.4. Can you point me in the right direction ?

Was just about to ask the same question about the Z touch plate!
Thanks Barry, I figured it out easily enough. Only issue I’m having is that my switches are in the usually on setting. Is there some firmware change I have to make in order to reverse this? (When switch is not depressed, circuit is closed and end stop reads triggered).

Ya, that’s in the configuration.h file (use Arduino to edit it). You’ll find a section with z_limit (or z_endstop, can’t remember)… set to true or false right along side the limit switch settings for x and y. Just change the value, save, compile and upload.

So I presume we are using the zmin end stop pins then and not aux 4?

I’m planning to configure a touch plate to do all three axis using the G38 command. Should be straight forward.

See this for how to add the X and Y G38 code:

So with the MPCNC you normally just manually position to find the 0,0,0 point. If I were to use a touch plate and limit switches I’d put the switches in place for X0 and Y0 and the touch plate for Z0? I’d connect the limit switches to the three pin connectors for X0 and Y0. (Three pin means both NO and NC should connected with center ground? Which side is NO? Which triple is X0 and which is XMAX, ditto for Y?) Where does the touch plate then connect to the RAMPs board? I’m assuming that the wire off the touch plate goes to an output on the RAMPS and the wire off the alligator clip on the tool bit goes to input pin (or visa versa). It probably doesn’t matter where the touch plate is sitting, but is there a procedure that’s standard (such as placing the touch plate at X0,Y0 then hitting home in Repetier Host or Estlcam)?


I use the X-MIN and Y-MIN end stops to home the router to one corner of my MPCNC (not for homing to the corner of my cutting stock, see further below). For that I’m using a 2-wire mechanical end stop in a normally closed (NC) configuration. I believe the logic here is that if there is a break in the circuit, the machine will not move. This adds a bit of safety.

For the touch plate, instead of using an end stop, you need to simply close a circuit in place of the end stop, so Z-MIN is used in a normally open (NO) configuration. One wire you clip to your router bit, the other wire to your touch plate. When the two touch Z is homed. Then use the g-code I mentioned to compensate for the thickness of your touch plate. You can test this by homing Z and touching the wires together.

Normal procedure is to manually move the router to the x,y position you want it at. Then home Z and add the g-code for touch plate thickness. Then run the job.

ESTLCAM allows for homing the X,Y, and Z using a touch plate already. From what I understand, the above process is much the same, but in ESTLCOM, it can check the sides of the touch plate to determine the X and Y position of that corner. You do have to tell it how much X and Y material there is on the sides of your touch plate. Usually the touchplate in this case is to find the coordinates of a specific corner.

Repetier can’t do this at the click of a button as far as I know. But the G98 code is there to allow for it. You should be able to add a script that will do this, which is what I plan to do soon.

One more thing I forgot to mention, this procedure uses the Z stop to zero to the plate. Using the G38 command I believe will require the use of AUX pin 5 “Probe” and not the Z end stops. FYI.