Auto Squaring, My axis is hella square…

New Home Forum Mostly Printed CNC – MPCNC Hardware Development – MPCNC Auto Squaring, My axis is hella square…

This topic contains 130 replies, has 30 voices, and was last updated by  Jeffeb3 2 months, 1 week ago.

Viewing 30 posts - 1 through 30 (of 131 total)
  • Author
    Posts
  • #42384

    Ryan
    Keymaster

    oh dang!!!!

    IMG_20170826_115353

    #42387

    Krzysztof Rygwelski
    Participant

    how you connect this limit switch? ;>

    #42409

    Ryan
    Keymaster

    I spent all dam day on this and finally did a google search and found some dude on the repetier firmware forums, http://forum.repetier.com/discussion/3634/dual-endstops-for-x-and-y

    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.

    #42410

    Kevin Lopez
    Participant

    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.

    #42414

    Ryan
    Keymaster

    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.

    #42417

    Krzysztof Rygwelski
    Participant

    keep hacking Ryan 😀 you getting there.

    #42583

    Ryan
    Keymaster

    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.

    Dude!

    #42604

    Ciaran Whelan
    Participant

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

    #42605

    Ryan
    Keymaster

    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.

    #42606

    Ciaran Whelan
    Participant

    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.

    #42607

    Ryan
    Keymaster

    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.

    #42608

    Mike B
    Participant

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

     

     

    #42609

    Ryan
    Keymaster

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

    #42611

    Ryan
    Keymaster

    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.

    #42638

    Vincent Pollaro
    Participant

    Wow! Very nice.

    #42683

    Philip
    Participant

    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

    #42685

    Ryan
    Keymaster

    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.

    1 user thanked author for this post.
    #42686

    Ryan
    Keymaster

    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.

    #42688

    Ryan
    Keymaster

    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.

    #42689

    Ciaran Whelan
    Participant

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

    1 user thanked author for this post.
    #42690

    Ryan
    Keymaster

    If you want to try it I will put the firmware up here but I have been rapidly changing this and didn’t want to keep up with revisions yet. So if anyone is ready to try it let me know but until then I will just keep going at it revision free for now. File management is a pain when revisions are many times a day/hour.

    #42691

    Philip
    Participant

    Appreciate this Ryan, will try and get a hold of some endstops from here to try it out, want to do some manual bed leveling for my mini Rambo for 3d printing, which apparently needs endstops (Open to any other options though, the bed is perfectly flat and seems like too much of a fuss to have to use endstops just to do a bed leveling once), but I guess I’ll have to get some eventually…

    #42693

    Ciaran Whelan
    Participant

    I will wait until it is at the point for testing Ryan. Am certainly keen to try this, but still very new to all this.

     

    I need to get comfortable with the software and my machine first before experimenting further than stock setup.

    #42696

    Jeffeb3
    Participant

    If you want to try it I will put the firmware up here but I have been rapidly changing this and didn’t want to keep up with revisions yet. So if anyone is ready to try it let me know but until then I will just keep going at it revision free for now. File management is a pain when revisions are many times a day/hour.

    Let me know if you want me to review your changes.

    1 user thanked author for this post.
    #42699

    Ryan
    Keymaster

    Thanks Heffe, maybe when/if I get the x going as well. It’s ugly but functional I had to take a lot of notes by hand. Marlin is seeming pretty scrambled, but incremental updates and overall ecosystem stability probably means a fresh start is near impossible for them. Or who knows maybe that is a well organized program, I guess I wouldn’t really know the difference. Your world is rough, programming is tricky I hope they pay you well!

    #42880

    Dan Leitner
    Participant

    Really interesting that you’re doing this right now as I spent the past two days figuring out what the issue in the dualXY endstop fork of Repetier was preventing X from working correctly.

    Turns out it was just the #ELSE following #DUAL_X_AXIS in Printer.h that comes after the MULTI_XENDSTOP code.

    I’m not at all up to speed on Github/Versioning, but I commented on the fork with the issues.

    https://github.com/repetier/Repetier-Firmware/pull/668

    Are you doing this in Marlin now or still with Repetier?

    Saw on the main post you are doing this now in Marlin.

    The issue there for me was editing marlin to allow zero Extruders seemed impossible.  As a workaround, you can edit the ramps pin assignment to dump E0 to usused pin 22.  This allows DualX to go to E1, which has E0 pins, and you create an E2 with the old E1 pins for Y.  Like so.

     

    #define E0_STEP_PIN 22 //Dump E0 pins to usused pin 22 to pass sanity check and allow Extruder 1 to be assigned to “nowhere”
    #define E0_DIR_PIN 22
    #define E0_ENABLE_PIN 22
    #define E0_CS_PIN 22

    #define E1_STEP_PIN 26 //Was E0, Now E1 so DualX is assigned to E1 at physical E0 location
    #define E1_DIR_PIN 28
    #define E1_ENABLE_PIN 24
    #define E1_CS_PIN 42

    #define E2_STEP_PIN 36 //Was E1, Now E2 so DualY is assigned to E2 at physical E1 location.
    #define E2_DIR_PIN 34
    #define E2_ENABLE_PIN 30
    #define E2_CS_PIN 44

     

     

    #42895

    Ryan
    Keymaster

    SWEEEEETTT!!!!!

    DAn the MAN!

    #42896

    Ryan
    Keymaster

    Sweet, so you have this fully functional in the repetier firmware? You only had to change three files?

    If you look back in the thread I think I found your’s or someones other attempt a few months ago.

    I thought marlin and repetier were basically close with repetier just using some sort of config script. But I am at 13 files changed in more than 31 places and that doe not have both the X and Y just the Y.

    #42939

    Dan Leitner
    Participant

    Short answer, yes, it is working fully on both axes.  Here is a copy of my current Repetier-firmware.

    http://www.danleitner.com/Repetier.zip

    Note, this is based on the development branch, and doesn’t work with CNC enabled (spindle control) or with extruders set to anything but zero I don’t think. I only looked at the xy homing code. As a next step, I’d look into making the same changes to the current master branch of Repetier and see how that works.  Obviously, if you are using dual xy motors and endstops on a ramps board, there isn’t a spot for the extruder motor driver so printing would be another issue entirely.

    More:

    I’m doing some work on my MPCNC so I haven’t done anything but test homing and run a bunch of G1 moves, but it seems to work.

    My experience is that Repetier and Marlin are similar but handle many things very differently.  I was using Marlin for everything (2 kinds of 3D printers and MPCNC etc) until I noticed a stuttering issue at certain feedrates, and after testing all the hardware as good, switched to Repetier and the problem disappeared.

    It was then I started looking for dualXY endstop code and found the Pull request on github by ikidd which worked for Y but not quite for X.  This included changes in 5 files and some specific changes to configuration.h

    All I did was figure out why the X-code wasn’t working and found a couple other things in general.

    I don’t know if you’d consider moving to Repetier as the main version of the firmware for MPCNC, but it seems to be more straightforward and compartmentalized than Marlin.  I’m happy to help with firmware development either way, but take note I am NOT a software engineer, I just grew up with some.

     

    #42941

    Dan Leitner
    Participant

    Post doesn’t seem to be showing up…trying again.

    Short answer, yes, it is working fully on both axes.  Here is a copy of this dualXY Repetier-firmware.

    http://www.danleitner.com/Repetier.zip

    Note, this is based on the development branch, and doesn’t work with CNC enabled (spindle control) or with extruders set to anything but zero I don’t think. I only looked at the xy homing code. As a next step, I’d look into making the same changes to the current master branch of Repetier and see how that works.  Obviously, if you are using dual xy motors and endstops on a ramps board, there isn’t a spot for the extruder motor driver so printing would be another issue entirely.

    More:

    I’m doing some work on my MPCNC so I haven’t done anything but test homing and run a bunch of G1 moves, but it seems to work.

    My experience is that Repetier and Marlin are similar but handle many things very differently.  I was using Marlin for everything (2 kinds of 3D printers and MPCNC etc) until I noticed a stuttering issue at certain feedrates, and after testing all the hardware as good, switched to Repetier and the problem disappeared.

    It was then I started looking for dualXY endstop code and found the Pull request on github by ikidd which worked for Y but not quite for X.  This included changes in 5 files and some specific changes to configuration.h

    All I did was figure out why the X-code wasn’t working and found a couple other things in general.

    I don’t know if you’d consider moving to Repetier as the main version of the firmware for MPCNC, but it seems to be more straightforward and compartmentalized than Marlin.  I’m happy to help with firmware development either way, but take note I am NOT a software engineer, I just grew up with some.

     

Viewing 30 posts - 1 through 30 (of 131 total)

You must be logged in to reply to this topic.