Finished the MPCNC build, some things remain unclear, Z-Max Endstop, Machine Limits


I have finally finished my MPCNC and while it took me a very long time from printing the parts, ordering from v1, and finally building the thing, I am very happy with the result. Especially since it came to life on the first try, even though I did all custom wiring. Only the Z-axis was reversed. I didn’t even fry anything with some reverse polarity or so. :slight_smile: Which is quite unusual for me…

I have built it with dual endstops, an SKR Pro 1.2 (v1 firmware) + TFT35. It is attached to a Raspberry Pi running CNCjs. It is quite big, approximately 1000x800x200mm.

Three things remain especially unclear to me, though.

First, machine limits. Where do I put them? I see that I can have a machine profile in CNCjs, but apart from that, I don’t see anywhere to enter them for my build on the SKR-interface. I’d really like to have them hardcoded in the firmware.

I have seen machine limits defined in configuration.h, but I am not sure if that is the right place.

// The size of the printable area
#define X_BED_SIZE 1220 // 200
#define Y_BED_SIZE 2440 // 200

// Travel limits (linear=mm, rotational=°) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define Z_MAX_POS 200

Second, Z-Max endstop. I attached one to the E2 endstop pins on the SKR1.2 and then enabled it in configuration.h by uncommenting:


The pins seem to be set correctly already in “pins_BTT_SKR_PRO_common.h”. However, I’m not sure about the “ifs” there.

  #define Z_STOP_PIN                  Z_DIAG_PIN
    #define Z_MAX_PIN                       PG5   // E2
    #define Z_MIN_PIN                       PG5   // E2
  #define Z_MIN_PIN                         PG8   // Z-
  #define Z_MAX_PIN                         PG5   // E2

I then compiled it and updated the SKR with that firmware. However, I don’t see it having any function. If I manually raise the z-axis, it runs straight into the endstop and would break it if I didn’t stop.

Third, while manually moving the machine with the controls on the TFT, the endstops don’t have any effect. The machine homes/squares fine to the endstops and the touch plate, but if I move it, say, for 100mm and then trigger an endstop, it just keeps on going.

All of my questions have a bit the same core: I know myself; I’m sometimes distracted, tired, or both. While rarely something bad happens because I know that about myself, I really want to take any measures I can to prevent the machine from running into its limits. Hence the z-max switch and the desire to have the machine limits hard-coded.

I’m not entirely sure if I’m just overlooking things or just going against the basic concept of the machine. From what I read in the forum, I did understand that endstops are not really needed apart from being handy for squaring. But that is precisely the reason why I feel like the machine limits should be stored on the deepest possible level and not just in a high-level application like CNCjs.

1 Like

Yes the printable area would be the right place. That just lets you home from further away since we do not use soft limits.

That would sensorless homing, we don’t use that .

Endstops are for homing only, you can change that but it is not recommended.

Did you build a printer or LR? Your bed size rather says LowRider.

1 Like

Thank you!

Sorry if this question paints me as a total noob…
We don’t use soft limits and the endstops are only for homing/squaring… So this means there is absolutely nothing but me preventing the machine from destroying itself?

@Tokoloshe it’s a MPCNC. Just a rather big one. With supports though. (1000x800x200)

The motors are strong enough for cutting under normal loads, but the motors will skip steps if you crash the machine by trying to go beyond the limits. It won’t damage the machine.

The greatest risk from human error or unforeseen conditions is dropping the router too deep into a workpiece and starting a fire with the collet. A few of us (that I know of) have made some smoke and used the E-stop to shut down the machine in a hurry.

With an E-stop and watching the machine, the worst case is not that bad (won’t destroy the machine), even if you are sometimes error-prone. Overall it’s very beginner friendly (whether or not you’re a beginner).

1 Like

Nevermind, I found my answers here:

Searching for “soft limits” did the trick. I didn’t try that keyword before.

It’s a bit disconcerting, but ok. Then that is how it is.
My instinct would be endstops on all sides and axis or hardcoded limits the machine will not exceed, given homed correctly.

It’s one thing to trust myself to never make a mistake, but on top of that I have to trust, the control board will never weirdly fail or just go HAL on me and keep going forward while sharp stuff is spinning at 10’000RPM.

It’s amazing to me, that endstops are not practically hardwired security switches on all ends, overriding even firmware. Given there are spindles and lasers strapped to that machine.

Thank you! That is calming me :slight_smile:

It is basically impossible to destroy it. :smiley:

I use another board and firmware, when I hit the endstops during a program it stops it. I think you can enable it as well.

1 Like

One of the issues with those stops is that they are moat commonly only at one end of an axis, so we woild only be protecting one side of the mechanism anyway. Since we don’t put stip switches at the max end (not do most of our boards actually support it for dual motor axes) we can’t actually protect both sides.

Soft stops do work, where you home the machine, and it knows that the X Y and Z axes have a certain amount of movement possible. The problem there comes in with the zero point.

For simplicity, the V1 firmware assumes that we are always using the machine coordinates. So if you jog the machine over a few dozen mm to where the corner of your work piece is and set that as zero, it doesn’t know that it is safe to go back that few dozen mm.

Since CAM programs like Estlcam like to set the zero point at the lower left edge, this means that we couldn’t cut out the shape, since you need to go to a negative coordinate in order for the cutting edfe to be at zero. So… we allow the machine to ignore its bounds and count on the user to set up the job correctly.

There is an alternative. Marlin does support work coordinates where you can define the machine space, home it and then it will know that wothin these mcoordinates it is only acceptible to move within the machine dimensions. Any commanded movement outside of that are will be rejected. I do this with my machies, but it is a more complicated setup and use case. It means that I need more things set up from the start before I can begin a cut. It is also entirely moot if a motor skips steps and the machine no longer knows its position.

1 Like