Dual endstops help

Ok so I have my MPCNC up and running.
I did the crown test and a few vcarvings.
Everything works really good.
I decided to try and calibrate the endstops for the auto squaring feature.
The diagram below is a 6"x6" square I did to check the squareness. Diagonal A measures 215mm and diagonal B measures 216mm.
What do I need to adjust with M666?

1 Like

I don’t know about the digital adjustment, but if it were my machine and it was off a millimeter for a 6" square, I’d keep working at it. How good is the corner to corner diagonal? Mine is less than a millimeter for a drawn 28" square for the diagonals.

Double check belt tension and where the stops are. Even getting the belt teeth aligned if possible.

With the dual endstops the machine can be square but not the actual endstop blocks since they can only be placed at 2mm increments.

So you can only offset the second stepper so offsetting y2 makes it worse X2 makes it better. The error is small so you can get away with offsetting the X2 stop probably .5mm or less. I bet the math is easy but guess and check is not horrible. I think this could be a fun calculator to build.

Also try using the largest rectangle you can to really dial it in.

If his machine was 6", that’s probably true, but the 1mm error was on the 6" square, so you’d need to adjust based on the size of the machine. If your machine was 24"x24", then you need to adjust by about 2mm. To make B smaller, X2 needs to go right, or Y2 needs to go up.

There is a sqrt(2) in there too, somewhere. :slight_smile:

1 Like

I made one a couple days ago, used it yesterday to square my 5’ table guide rails and stop blocks to less than within 1/32 as far as I can tell with my tape measure. Ill think on adapting for mpcnc.

Its a librecalc spreadsheet, I’ll post it when I get to that computer later.

4 Likes

Geometry and overkill is where I shine!

Assuming you’ve drawn a parallelogram (opposite sides are equal length) you can calculate the adjustment amount like so

(please excuse my crude drawing)

using the law of cosines
θ = acos((a²+b²-D²)/(2 * a * b))
where D is the diagonal measurment from corner to corner. Get the correct diagonal… just a reminder that they are different.

Simply shift an a rail in a horizontal direction in the amount of x to square up the parallelogram
x = b*sin(90°-θ)

Now I leave it to you guys to figure out how to make a calculator out of this that is generic and easy enough to understand to work with everyone’s setup. There’s no standard and everyone orients their x1, y1, x2, y2, and end stops differently (why I labeled this a and b instead of x and y).

(edit)
@wupinstick You should base your adjustments off the biggest rectangle you can draw but based on what you’ve shown you could try offsetting from your y2 up 0.67 mm or y1 down 0.67mm… I think… I hope because scale comes into play here.

4 Likes

Good math, checks out.

But, the triangle is almost an equilateral triangle… So long as you’re talking about less than a few mms over a few feet, it makes me think there is a very good approximation. Something like:

1/1.41 * diagonal error / square length * side length. But that may still be off by 2x.

Yeah my cut area is 24"x24". I ended up moving the x2 endstop 2mm to the right and that fixed it.

1 Like

Almost a right triangle. If the side lengths are approximately equal, i.e. not a long and narrow rectangular build, then shifting one side by x should make one diagonal longer by x/sqrt(2) and the other diagonal should be shorter by x/sqrt(2) so the difference in lengths should decrease (or increase if you went the wrong way) by 2x/sqrt(2) = xsqrt(2). So then for a given diagonal difference error E, the correction x = E/sqrt(2).

If the build is not approximately square then the relationship between x and diagonal change will be different. I think it would be E = 2xcosine of the angle of the diagonal but I haven’t checked it out in full detail.

Why approximate when it’s so easy for the computer to exactimate? I’m imagining gui that asks the user about their machine’s dimensions, configuration, and these calibration measurements and then draws an exagerated parellelogram illustrating the error in their machine and where to make adjustments relative to how their machine is set up. I could script the back end but don’t know best way approach the gui.

Because there is a non-exactimatude inherent in the system, and you start chasing ghosts and expecting M. Night Shamaylan to start making good films again. :clown_face:

1 Like

If you’re doing it by hand, sure. But if you’re making a calculator there’s no point.

Fair enough… If you’re going to bend the electrons to your will, might as well get them to compute all the digits… It’s not like they have labor unions or OSHA regulations to worry about.

Is that a hint of snark I detect? We’re all here to have fun…

Yet…

1 Like

Of course it’s snark. That’s my primary means of communication. Especially when it appears that there’s no impending threat of nerd-rage, internet huffs, rage quits, or bruised fee-fees. :smiley:

Or actual, profound usefulness…

1 Like

Well that’s disappointing.

Oh… Maybe you and I have different definitions for “snark”. Mine is basically being a bit flippant, slightly surreal, and usually aimed somewhere off-target. It’s rarely used in a malicious or deliberately hurtful manner. I reserve that for telemarketers and the occasional door-to-door proselytizer (I’m a devout pantheistic agnostic, with pastafarian leanings).

I prefer the fish and chips.

Endstop questions comes up often enough I still think a dummy proof configuration utility would be useful to the uninitiated. I realize making something square ain’t rocket science but when we throw in firmware configurations and start referencing non-standardized machine setups that’s when people start to get headaches.

1 Like