Automatic bed levelling using 2 or 3 Z motors



  • I just don't get it

    You type the following code in the first message of this thread

     Use M584 Z2:3:4 to assign 3  motors to the Z axis
    - Home Z at bed centre using the Z probe
    - Send M584 Z2 to enable just the first Z motor
    - Send G91 and G1 Z1 to drop the corner or edge of the bed driven by the first motor by 1mm
    - Move the probe to be close to the first Z motor, then probe again
    - Send M584 Z3 to enable just the second Z motor
    - Send G91 and G1 Z1 to drop the corner or edge of the bed driven by the second motor by 1mm
    - Move the probe to be close to the second Z motor, then probe again
    - Repeat these 3 steps for the 3rd Z motor
    - Send M584 Z2:3:4 to enable all 3 motors again
    - Do a final probe at bed centre to fine-tune the Z height
    
    

    So you first attach (in my case with 3 steppers) the 3 z steppers to Z, E0 and E1 with M584 Z2:3:4 and you home the Z with all 3 steppers enabled in the center of your buildplate

    THEN you let 1 corner lower 1mm while disabling the other 2 z steppers

    While this should work (somehow), that means that if a customer begins with a perfectly level z plate, this technique is going to tear the 3 corners out of sync by 1mm one after the other. That places unneeded load on the system, because you want to make your system as rigid as possible and then you instruct software to do movements which hurt your bearings (maybe not much, but it does hurt. I even don't know if for example ball screws will even tolerate that amount)

    What I understand under auto-leveling is more like this

    A) Enable 3 outputs for Z with M584 Z2:3:4
    B) Move XY to center of the printbed
    C) Home Z on the center of the bed
    D) Move the bed down for example by 10mm (Which theoretically allows the bed corners to be 10mm off, which is insane, you can also do 5mm instead because that amount of bad leveling is easy to see with the naked eye)
    E) Now go to a position as close as possible to the first Z motor leadscrew and home on Z at that position (STILL WITH ALL 3 MOTORS enabled)
    F) Go up (lowering the plate) again to the starting position before before probing Z at that location (or 5mm, you get my point)
    G) Now do the same with the 2 other leadscrew positions, so move the gantry as close as possible to the leadscrew and home that Z position (while having all 3 z steppers still enabled and moving too)

    Using that method you register the relative distance needed to home Z on the different locations (to be honest, the center location is even not needed)

    Now suppose that I have 3 screws for Z (one left front, one right front and 1 back center)

    If my test would register these offsets to home correctly

    Z1: 7.24mm
    Z2: 8.12mm
    Z3: 7.80mm

    Then that means Z1 is too high and Z2 too low

    (7.24 + 8.12 + 7.80) / 3 = 7.72 mm

    That means that you need to make Z1, Z2 and Z3 move

    Z1 by 7.24-7.72 = -0.48mm
    Z2 by 8.12-7.72 = +0.4mm
    Z3 by 7.80-7.72 = +0,08mm

    Using this technique, you should already have a lot better bed level, but… this is indeed not the end. Because we don't measure/probe at the exact leadscrew location, you will need to do this a couple of times after eachother. The offsets will always become a lot smaller until the offsets will be within a predefined acceptable level (for example 0.02mm , but maybe you even want smaller level, it also depends on the accuracy of your level sensor).

    I'm pretty sure that after 3 to 5 iterations this would mean an almost perfectly leveled printbed.

    1 Advantage is that if the bed is already level when you start this leveling procedure, then the bed is never taken out of level by the procedure and you don't "tear" the bearings or whatever guidesystems 1mm out of sync. I know people who use linear ball guides and these just don't accept that kind of tear on them. Ballscrews also don't like it. A bed that was allready level, will also finish leveling very quickly because after the first probing the system would already detect all 3 points to be perfectly level and the procedure would stop.

    So.... in my opinion it would be very handy to have a routine which lets Z motors level using some sort of gcode/mcode call where you can specify the needed locations to home the 3 points (or 2 if you happen to have only 2 screws like the bigbox) + the distance to go up/down and the requested tolerance you need before the routine may stop itself and call it DONE.

    I don't think this can be done using just a macro (correct me if wrong). It should however be quite simple to implement in software , but you need to be able to record the 3 z offsets measured in the probing, then calculate their average and the deviation from it, then move the Z motors according to that deviation and repeat the routine until the needed tolerance is met.

    People could then use this routine to 100% surely level the plate (because multiple Z motors can and will go out of sync when the printer is not powered) and after that you could do a mesh bed leveling and be absolutely sure of the best possible setup of your Z buildplate.

    A little demo of this can be seen in the following video: https://www.youtube.com/watch?v=76bUTPKNloM

    What do you think about that ?

    Kind regards ,
    Bart



  • My twopence worth. If the bed is rigid and won't allow 1mm of movement in a corner, then it doesn't need automatic bed levelling with 3 motors. Level it manually, drive the 3 screws with a single motor and a continuous belt - job done. But that isn't what this thread is about. People have requested automatic bed levelling as a firmware "wish" so presumably those people have machines where the bed isn't that rigid and/or they have designed their printers to allow some flexing at the carriage/bed mount. It's not difficult to do.



  • This thread is called automatic bed leveling using 2 or 3 z motors so my post is totally relevant. The main goal of my post was to illustrate that that 1 mm out of sync is not needed and does in any case (rigid or not) make more stress than needed. Thats because it does the whole thing even if a bed was allready level. And even the most rigid machines may need some leveling, even if it is only to take 0.1mm of uneven leveling away. That can be done easily in auto leveling.
    Regarding connecting 3 axes with 1 belt, that is a possibility to not go out of sync, but if this technique is used then you can't use auto leveling and belts can also stretch over time… . That is why my post here is totally relevant. Even the most expensive cnc machinery with 2 or more motors which should run in sync use some kind or techniques to sync these motors, and mostly it is not by belts.



  • I didn't say that you post was irrelevant. In fact if you re-read it, I didn't use the word at all. David started this thread as an example of what he was thinking of doing and asking for feedback. Various people have put forward suggestions, as have you. No need to rant.


  • administrators

    I agree that it's better to move the whole bed when probing all the points and make the correction at the end. The purpose of my post was to point out that it may be possible to do this type of bed levelling already without any firmware changes.



  • Deckingman, I also didn't mean to rant or whatever. Sorry if it came over like that. We all want to build the most perfect solutions possible, thats all.

    David, I still don't really understand how it would be possible with current firmware. I don't know the firmware as good as you of course , but the demo code you gave above (with all 3 motors on or not) it capable of detecting the z probe distance at for example 3 points.

    So suppose you probe the bed at 3 places with these gcode commands. What then? I guess you need to calculate the offsets manually and have to adjust each z motor individually to level ?

    Using that technique, I would guess that a leveling is these steps

    1. With all 3 motors on, lower the z bed for example 10mm
    2. position probe closest zo z1 motor and do a homing on Z with all 3 motors on . (take note of the distance needed to home)
    3. Set Z bed down again and move probe to the position closest to z2 screw
    4. probe again and take note of the distance there.
    5. do the same for Z3 motor.

    But then….

    After that you have the 3 offsets. I guess then you have to calculate the average of the 3 offsets manually by yourself and then 1 by one enable the Z motors and set them to the calculated offset position ?

    This process should be repeated a couple of times, so as far as I understand at this point, this is not fully automated and required me to take note of offsets, calculate averages and position individual z motors multiple times by hand ?

    Or is there some kind of scripting language or system implemented on the duet which enables me to program this to be happening automatically ?

    Bart



  • Hi Bart,

    No problem. I think the idea that David is putting forward is this. Probe the bed in the centre. i.e. enable all 3 motors then home the bed to the trigger height - for the sake of argument, lets say it's 2mm. Then move close to one of the screws, disable the other 2 Z motors then using just the one motor, drop the bed by 1mm (to ensure that it is below the trigger height, then probe the bed at this point - i.e using just one motor adjust the bed back to the trigger height of 2mm. If the bed was level to start with, this would be the same position, otherwise it will be adjusted. Repeat this process for the other two screws. A second iteration might be necessary but after that, in theory the bed should be level as long as the motors remain in sync (and nobody turns one of the screws when the machine is switched off).

    So there aren't any offsets to remember and a macro could be created which would run this process automatically.

    HTH

    Ian



  • That could indeed work. It will end up with a leveled bed.

    Only negative I see is that on an allready leveled bed this is moving 1 z motor while others are not moving, so producing tear on the axis which is unneeded.

    I do agree that most systems will not see a lot of problems in this. It is just something that bothers me a bit, but its not the end of the world.

    I plan on leveling my 326x326x8mm aluplate (pei coated) with 3 T8x1 leadscrews (like you use too on your corexy) and then mount the plate RIGID onto the frame that connects to the 3 nuts. I don't plan on implementing leveling screws between the z stage and the buildplate itself since technically speaking this solution should be able to level the plate to 0,01mm anyway and thereafter you can do a mesh bed leveling to factor out al unevenness.

    I still think engineeringwise the best option is to probe the 3 points with all motors on, then calculate offsets and reposition the motors. An already leveled bed will need no adjustments and leveling procedure will be very fast and even on a unleveled bed (which we make this calibration for) the out of sync movements which are more or less harmful for the guide system will only move the least possible (calculated) offset.

    PS. While I have your attention. On your printer what do you use for guiding your Z table so it can't have horizontal wiggle room? I see wheels. Are these special types ? I plan un using 16mm precision shaft and LMF16UU bearings.


  • administrators

    @educa:

    I still think engineeringwise the best option is to probe the 3 points with all motors on, then calculate offsets and reposition the motors. An already leveled bed will need no adjustments and leveling procedure will be very fast and even on a unleveled bed (which we make this calibration for) the out of sync movements which are more or less harmful for the guide system will only move the least possible (calculated) offset.

    I already agreed with you, see my previous post.



  • Yes I understood that David. It was more an answer to Ian actually.

    Is something like this planned to be implemented in firmware anytime soon ?

    I would make a difference on which boards I have to buy for my build. Normally I would buy a duet wifi, connect X, Y, Extruder1 and Extruder 2 to the duet wifi and then map the z drive on expansion header to do my own stuff with it.

    If it is working in firmware, then I will need to buy at least an extra duex-2 so I can hook the X and Y + the 3 Z motors to die duet wifi and then the 2 extruder motors to the expansion board. At east that is what I think I have read that it is best to have 1 axis on the same board, so for 3 z motors that would possibly be my best bet?


  • administrators

    It doesn't make any difference whether you have the 3 Z motors on one of the boards or split between them.



  • Ah ok. I thought I read that somewhere. So if I need X, Y, 3 times Z and 2 extruders, I just need to make sure that I have a DUET + a Duex2 and it doesn't matter how I map them. Nice 😉



  • @educa:

    T….............................

    PS. While I have your attention. On your printer what do you use for guiding your Z table so it can't have horizontal wiggle room? I see wheels. Are these special types ? I plan un using 16mm precision shaft and LMF16UU bearings.

    Hi Bart,

    The best way to answer that is to give you this shareable link to my google drive folder that has pics of the lead screw and Z axis mounting arrangement. https://drive.google.com/drive/folders/0B_MwtHtQR_ZvdHY1dXdxb2RQVm8?usp=sharing

    As with the rest of the printer, the guides are open builds V slot (2020 in this case). However, I started with 2 only guides but when I built it, I found it was possible to "rotate" the bed slightly by hand. Closer inspection revealed that the guides were able to twist because, being 2020 it is only possible to use 1 bolt where they fix to the horizontal rails. The easiest fix at that stage was to install a 3rd guide but if I was starting from scratch, I'd have used 2040 with 2 bolts at each vertical to horizontal intersection.

    I used open builds mini gantry plates and twin bearing Delrin wheels. The coupling between the guide and the plate mount is via a rod end rose joint which allows the vertical bolt itself to swivel to allow for any misalignment whilst still constraining the bed from any "wobble". Then I fitted "O" rings between the brass lead screw nut and the bed mounting plate. The bolts are tightened to just slightly compress the "O" ring and nyloc nuts prevent them from coming loose. This arrangement allows the bed to be tilted slightly without putting any twisting forces on the guides (which I know you are concerned about).

    As I mentioned earlier, I originally planned to use 3 motors for the automatic levelling feature when it became available - that's why I designed the printer this way. I don't have any form of levelling other than by slackening the pulleys at the bottom of the lead screw and rotating the screw. Now that it's built and running, I've found that I adjusted the bed initially, then again after the initial settling in period of a few hours, but since then I've never had to adjust the bed level. So, I've abandoned all plans to change to 3 motors.

    In fact, I don't use any form of compensation either, levelling, flatness or orthogonality (is that a word?). I have "home all" as part of my slicer start code along with bed and tool heating, so when I want to print something, I just turn on the printer, select the file, hit print, and walk away. Now that I've got it all dialled in, it's as easy as printing a document on my PC's printer (takes s bit longer though 🙂 )

    In case you haven't seen it, here is a link to a video that I have shameless bragging rights to. It's printing a 300mm x 300mm square without using any form of bed compensation.https://www.youtube.com/watch?v=U733PMTou7M

    HTH

    Ian



  • That looks great Ian. It's great when a machine is well built, sturdy and reliably level, but these aren't really the machines that auto levelling is aimed at. Once you have a machine like yours it all seems a bit pointless. I can't really see it appealing to people with a z axis with multiple leadscrew with multiple guides, these things are sturdy and once set by manually turning screws relative to one another, it's set for good long while. It's really the cheap more mass produced machines that need it. The bed has to be level/orthogonal, and the easiest way to do this on a cheapo printer would be to have a bed with 2 tiny motors driving small screws to adjust 2 points with a third fixed point and a sensor. DC motors would work if the screws were quite fine pitch.

    I started with ABL on my corexy, then improved the mecahnics, then got rid of ABL as it never went out of level.



  • I'm running a duet 0.6. Upgrade to DuetWifi|Ethernet would require me to get the new board and expansion card. I can't see the Due4 for the Duet 0.6 for sale anywhere.

    Is this card suitable for this feature?

    Can't see why not, but rather ask a question and get a seemingly obvious answer as opposed to getting a surprise after I try it out!


  • administrators

    Yes that should work if 6 drivers is enough. I can't remember what driver numbers the 2 extra drivers are, possibly 5 and 6 instead of 4 and 5.



  • Thanks. I'll bare the numbering in mind!


Log in to reply