Dual endstops and stepper issues

Apologies ahead of time. I am completely lost in this process because I was unable to find a straightforward, complete step by step on how to do this. I bought the Rambo (I upgraded from mini Rambo) and used Arduino IDE to install the Rambo Dual file from github. The endstops all tested correctly using Repetier host.

The firmware came pre-defined as - 1 for the homing definitions, as I saw them in Arduino IDE.

When I hit home in Repetier Host, and tried to use my finger instead of the end stop, the stepper that hit my finger (Y in the minimum position) stopped moving. However, the other Y stepper across from it kept traveling, making the metal post kind of rack itself.

I have not seen this problem described anywhere. What would cause this?

The CNC was in full use with the Rambo board before trying to add the endstops, so I know the steppers were wired to the board correctly.

Any suggestions would be appreciated. And if anyone has a link to a detailed instruction guide for how to do this, that would be great. Thank you

That sounds like it is working as designed. Each stepper has is own endstop and they continue moving until reach endstop is reached. This way, if the machine starts out of square. It will be square after homing. You can also define an offset from one of the endstops with M666 (in case your endstops aren’t perfectly square).

As Jeff indicates, this is correct behavior. Now square your machine by homing X and Y and then use a pen attachment to draw a large rectangle (nearly as big as the working area of your machine). Measure the diagonals of that rectangle. You want to adjust either the physical placement of the endstop stop blocks or use M666 until your machine draws a rectangle where the diagonals match.

Note, if you are just getting your machine running, I suggest running the crown test gcode file before working on squaring your machine.


Your comment made me realize I may have been misunderstanding everything from the beginning. I went back to some photos of people’s builds, and I think I may have found an issue? I’m attaching a photo to describe the situation.
My endstops are in black. In the concept of min and max values of x and y, I put them at the min and max places of travel on each axis. So, at x =0 in the lower left, it would hit an endstop. At x = max, there’s another endstop in the upper right. And same for Y.
But in other builds, it looks like the endstops are supposed to strike simultaneously on the left, as x reduces, and simultaneously again in the lower left and right, as y reduces. Is that correct? In my drawing, there are dotted lines where I think I should move my endstops (and then re-orient the striking mechanisms).
If that is correct, am I supposed to move the gantry and just eyeball the endstop placement, so that the x and y pairs get hit at the same time?

1 Like

Yes, “simultaneously” on the left and bottom. As indicated by our original answers, it doesn’t matter if the gantry starts square when you first start homing. The steppers + switches will keep each end moving until that end hits the switch. If your machine is not square when you start homing, one switch will hit first, but the second will hit almost immediately after so that both ends stop just as their respective switches are triggered. There is no eyeballing involved.

As for stop block placement, start by measuring out from the corner so that both stop blocks are the same distance from the end of the machine. I installed my stop blocks so the switches are triggered just before the core hits the trucks. This maximizes the cutting area, but also provides some protection to the switches if the cutting area is ever exceeded.

After you have the stop blocks placed, run the rectangle text I outlined in my last post. If the diagonals are not equal, you can either slide the stop blocks forward or backward or use M666 to adjust the machine. The goal is for the machine, once homed, to draw a “perfect” rectangle. Note that a slight difference in diagonals will not show up in most cutting, so don’t stress if you cannot get the measurement perfect.

Note that I am confused about how you managed to install the switches in the way you did. There are mounting holes on the trucks for the switches that place them correctly for “simultaneously” triggering.

1 Like

Thanks so much, I will make those fixes and report back.
I had removed the plastic mounting “trucks” and flipped two of them over, to accommodate my understanding of where the endstops should be.
If I’d left them alone, then the switch pairs would have been on the same sides.
I guess when engineers are trying to figure out all the ways a user can get something wrong, they’re thinking of me.

1 Like

I remember when I built my Burly I managed to mount the core on the wrong side of the axes, so if there is an easy way for builders to get something wrong, someone will. Fortunately, the machine was easy to disassemble.

Great drawing and I’m glad you were able to see the result.

It is an easy mistake to make. Not sure why that doesn’t happen more often. Endstops are something we all know about, but the way we use them here is different than most CNCs and different than 3D printers.

1 Like

Thank you Jeff and Robert. The homing works on X Y. I can’t find the touch plate from V1, and the other one didn’t have the Dupont connector, so I had to order a new touch plate from V1. Once that arrives, Z will hopefully get squared away.
I think next steps include the offsets to make the gantry square. Did I read somewhere that you can add the offset into the firmware using Arduino IDE? Do you happen to know how to do that?
Once that’s done, I’ll have to learn how to position the origin on my projects so there’s no negative x y, and figure out a way to place the projects in the CAD model.
My idea is to have a small bit trace out a grid, like graph paper, on my MDF spoiler board. That would let me align my project wood to the gantry. Then, I could go into the shop and count the rise / run in squares, and make sure I was modeling the edge of the project that far away from the origin in the program (if that makes sense).

To start with, if you were careful when you built your machine, you may not have any adjustment to make. IMO, it is easiest to make squareness adjustments by physically moving the endstop blocks rather than making firmware changes. If you want to adjust through firmware, I recommend using the M666 gcode rather than editing and recompiling the firmware. After executing an M666, you must execute an M500 to save the changes. The reason I favor M666 is a bit complex. When you make parameter changes like M666, any changes directly in the firmware are ignored. This means the adjustment you make is preserved when you update your firmware. If you did it directly in the firmware, you would have to remember the value and edit the configuration file every time you wanted to do an update.

If you want to do it directly in the firmware, be aware that Marlin no longer compiles using the Arduino IDE. You need to use Visual Studio Code and PlatformIO. Ryan provides instruction at the link. The values you adjust are in configuration_adv.h and use the following two defines:

#define X2_ENDSTOP_ADJUSTMENT  0
#define Y2_ENDSTOP_ADJUSTMENT  0

I’ll have to learn how to position the origin on my projects so there’s no negative x y, and figure out a way to place the projects in the CAD model.

The way most MPCNC users solve this problem is to set the machine origin relative to the stock just before beginning a job. In CAM you define the origin point used for the gcode. Typically, you would select a point based on a corner or the top of the stock. Most of the time, I pick the top, front, left corner of the stock as my origin point, though there are occasional times other stock points make more sense. When I want to run a job, I place the tip of my pit at that origin point defined in the CAM and execute a G92 X0 Y0 Z0. This establishes that point as the origin.

My idea is to have a small bit trace out a grid, like graph paper, on my MDF spoiler board.

Since cutting is done relative to the stock, having a grid to measure is not necessary. A grid is helpful to ensure the stock is aligned with the CNC. I would recommend using your CNC for some time before milling the grid. Things happen during the shakedown/ramp up phase of using your machine that may invalidate the grid. In addition, until you’ve surfaced your spoil board, it can be difficult to get grid lines of consistent depth. And like gridlines, you want to gain some experience before surfacing your spoil board.