Auto Squaring, My axis is hella square...

oh dang!!!

[attachment file=42385]

how you connect this limit switch? ;>

I spent all dam day on this and finally did a google search and found some dude on the repetier firmware forums,

I will just stop for the day and see where he gets in the morning.

I can tell you it works better than expected and could make the MPCNC (any machine with independent driven axis) seriously easy to use with great accuracy very easy. It even has a software offset ability so you don’t have to try and get the endstops in the perfect place or use a screw adjuster.

This is an example when being square is cool. I thought you didn’t like endstops? Or are these different in some way? I may upgrade my machine to ss pretty soon and this would be a good addition to my mpcnc pro edition.

Quad independent drive, auto squaring. Whole new level of marlin… Im hopeful but not very confident in my programming. 10 or so hours and I would say it compiles 90, for 1 extra axis.

keep hacking Ryan :smiley: you getting there.

Okay I have it much closer now.

I had to edit 13 files in about 31 places to get it to work to this point.

Z axis auto dual end stops has been in marlin for a while but the edits were/are extensive to make it work. Z does nothing for us.

Ideally we would have this on both axis but the X is a bit more complicated. I will work on it ASAP but this will work as is.

If you home the X axis with a stop block on the side that will hit first and an adjustable end stop on the other the x can be homed square. Then the dual end stops can be used the Y axis to home it and drive it into position and then it should be square and locked.

This will then engage all steppers and hold them square, if you are unsure you can then home them again to verify. This will work for super out of whack builds but will work best on builds that are closest to square so the motors are not under such great pressure all the time to hold it square. Ideally this will just shift an already square axis they gets cockeyed from the frame from dragging it around by hand.


So I’m going to go order some limit switches for the project once you give the all clear as well as firmware update.

I have some really high hopes for this, and there is finally a reason to use endstops. Wiring up the X axis now, maybe shoot a quick video of it in action.

I am guessing any type of limit switch will do? I am hoping my local electronic store will have what I need. 4x switches per axis?

Lucky I have the mini Rambo as well.

So in full for it will need two for each axis and some sort of touch sensor/plate for the Z axis. The mini rambo does not have enough drivers for the full for so it will only need 3 switches and a touch plate.

I have not solved all the issues yet so no mini rambo love yet, sorry. I have to figure out how to move the extruder driver assignment or turn it off somehow. The easy way of setting extruders to 0 does not work but would be awesome.

I am setting it up on my small Stainless build…this thing is less than 1mm off square no matter what I do. Hmmm, I’ll find away to skew it for the sake of science.

this would be amazing… You’re certainly on to something here.



It works so far, wiring up my other axis to do a full 3 axis homing.

Well now I have done my first G28 ever on an MPCNC, pretty slick. I will have to put in some work on the X axis firmware tomorrow.

Wow! Very nice.

Just to clarify what you are up to, it sounds very interesting, but I do not quite understand the purpose of it (Not at all saying it is pointless, probably very useful, just would like to fully to understand what it is used for, and the benefits). When you say square you mean to have the x and y rollers directly across from each other, or to have parallel side conduits? I’m sure this is a helpful upgrade from the previous version by the excitement going on here, just need to confirm what exactly is wrong, and how a slightly non-square machine affects the workpiece

To me this is a luxury thing, but for complicated processes it can make some multi process jobs very easy and can be very necessary for advance users.

This is very similar to 3D printer auto leveling. I don’t use 3D printer auto leveling but some people swear it revolutionized 3D printer ease of use. In a 3D printer you either take the time to set your bed level and rarely really have to worry about it, or you just run the software auto leveling (leaving mesh out of it). This means getting good repetable results is very easy for anyone.

This is very similar on a CNC, when you drag the gantry around by hand to when you first start it up it very well can be out of square. Meaning if your machine X and Y rails have been properly assembled and are level and square the gantry can very easily still not be. The other problem is some people just can not seem to get the center gantry really really square. This can help with both of those issues. When you power up this can use the power of the steppers to pull your machine into a very accurate square.

The other thing this does is let you take advantage of work offsets and easy project flip and tool changes where setting the start point several times is critical and can be touchy.

Leaving multi process jobs out of this, right now before all my dimension critical cuts I move my gantry to the start point, measure the distance from each roller to a corner and compare to make sure my machine is square enough for my purposes. This takes about a minute for every job, some people use stop blocks and spacers. Using and endstop gives much more repeatable results and take almost no thought from the user. Just like every printer “homes” before a print, using this we too can now “home”. The flip side of this is this adds complications. You don’t always have to use it but if you do you will have to know your exact work offset, and some other things.

The reason we can do this now is a single endstop will do nothing to correct a twist in your gantry, this can now stop a motor and drive one until it is square. The motors are not wired in series they are on there own driver. This will also allow for things like fixtures to be used for some low volume micro-manufacturing, and multi-process jobs.

A non square machine will cut parallelograms instead of squares, and ovals instead of circles. Most carves and artsy stuff doesn’t matter if you are a tiny bit out of square. Things like cutting parts for the MP3DP it matters very much. A non square machine also makes stopping and continuing a job next to impossible because it can very well have shifted and then the cuts will not match up. This will not mean the reputability of this any any other dual drive machine will approximately equal to the resolution of the end stops used.

That being said, my 23"x 23"x 6" machine holds square so well I can’t use it for testing, I can;t tweak it further than 1mm out over 23". I have to use a machine I don’t mind loosening up to be able to tweak it enough to know it is doing a accurate job. For some they have never been able to square theirs that well and for them this means a much easier experience with more precision cuts.


Or I guess I went off the deep end with that.

The easy answer is we can now(almost) drive every single stepper independently and home them individually. Previously 2 of the steppers were just slave drives along for the ride with no way to control them independently.

This will make things better for any marlin based machine with any axis that has more than one motor. Machines driving there axis with only one motor could begin to have a disadvantage to a more controllable machine. If you only have one motor the squareness of your cut depends on the rigidity and the accuracy of your assembly.

One more thing. I am not claiming to have invented or developed any of this, The dual enstops is already in Marlin, just 3D printers have no use for any other axis homing individually other than the Z axis usually so it is not in there by default. I just hammered away at it and cloned it to the Y axis, hopefully soon the X as well. Driving the steppers independently has been in there for a long time so I didn’t have to touch that.

Very well done Ryan. Am looking forward to the results. I have picked up my limit switches in anticipation for this.

1 Like