Close



Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Engineer-in-Training gmay3's Avatar
    Join Date
    Mar 2014
    Location
    USA
    Posts
    388
    Add gmay3 on Thingiverse

    Questions about How Auto Bed Leveling Works

    Hey auto bed leveling Guru's,

    Seeing all the activity on auto bed leveling, I'm trying to get up to speed on how Auto bed leveling works. I understand the basic mechanical concept of taking the measurements with the servo/switch assembly, but I'm unsure of how the software takes this data adjusts your print.

    From what I gather, the servo probe starts from a known Z height, approaches the bed, and gets a Z measurement when the switch is pressed. It takes 3 or so measurements around the outside of the bed to measure 3 Z distances and calculates the current XYZ angle tilt of the plane, stores it in memory to adjusts the print.

    As a simplified example just for the X axis, say I'm printing something at 0.2mm layer height and the right side of my bed is at "0" and the left side of the bed is 0.2mm above that "0". Normally, on the first layer the Z axis is fixed and does not move and would stay at "0" across the X axis and crash into the glass somewhere on its way to the left side.

    Does auto bed leveling allow the Z axis to dynamical vary during the first layer from 0 on the right to 0.2mm on the left instead of being completely fixed at 0?

    If this post has a repeat somewhere else on the forums or has already been explained, I will gladly delete it! Thanks guys!

  2. #2
    Technologist Tachout's Avatar
    Join Date
    Jun 2014
    Location
    Sandy Utah
    Posts
    119
    I think this is a great question. I think I understand that it dynamically will adjust the Z plane throughout the print and not the first layer, however I may be wrong.

    Another question... I have seen several different posts and have not read all the way through them as I have not started this process yet. I did however watch zenmasters video series, and also have been reading some of the posts as I see something new posted so if this has been answered please ignore me.

    Can I get the auto bed leveling to take more than 3 points. I want it to take 3 to 4 across the x and y. I would like to see it do 9 to 12 points on my bed as it is now. Is this something I can get it to do if I can tell it where I want those points to be?

  3. #3
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    Quote Originally Posted by gmay3 View Post
    Hey auto bed leveling Guru's,
    Does auto bed leveling allow the Z axis to dynamical vary during the first layer from 0 on the right to 0.2mm on the left instead of being completely fixed at 0?
    Yes, once the bed level correction matrix is generated... All coordinates given by the GCode get translated to the new coordinate system. Check out:

    http://3dprintboard.com/showthread.p...ll=1#post27846

    Quote Originally Posted by Tachout View Post
    Can I get the auto bed leveling to take more than 3 points. I want it to take 3 to 4 across the x and y. I would like to see it do 9 to 12 points on my bed as it is now. Is this something I can get it to do if I can tell it where I want those points to be?
    The original code took 3 points. If you want to do that for legacy reasons you can. The 3 point plane is still in the firmware. But right now the firmware is doing an n x n grid and taking a least squares fit to determine the new coordinate system.

    There is work in progress from some of the people here to automatically limit the n x n grid being probed to the size of the print on the print bed. This will help accuracy.

  4. #4
    Engineer-in-Training gmay3's Avatar
    Join Date
    Mar 2014
    Location
    USA
    Posts
    388
    Add gmay3 on Thingiverse
    Thanks very much Roxy, it's cool to see how the code creates this matrix of measurements. The amount of work to implement auto bed leveling in the Marlin Firmware must have been extraordinary!

    Are the measurements taken every time a print is starting up as part of the normal printing routine or are they done only when you want?

    If it is automatic/included in every print start-up sequence, does it measure while the bed is hot?

  5. #5
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    Quote Originally Posted by gmay3 View Post
    Thanks very much Roxy, it's cool to see how the code creates this matrix of measurements. The amount of work to implement auto bed leveling in the Marlin Firmware must have been extraordinary!

    Are the measurements taken every time a print is starting up as part of the normal printing routine or are they done only when you want?

    If it is automatic/included in every print start-up sequence, does it measure while the bed is hot?
    Whoever did the original work was a truly gifted individual. It was a lot of work.

    There was somebody here exploring the possibility of saving the bed correction matrix in the EEPROM so it doesn't have to be constructed at the start of each print. I don't know where in the process that work is. Or if it will see the light of day. It really isn't that hard to do. All the support routines for the EEPROM and default settings is in place to do it.

    So right now... You just do a G28 and a G29 at the start of each print and the correction matrix is generated and used during the entire print. I have my Slicer Start Up GCode wait until the bed is up to temperature before doing the probing. That seems to help accuracy (at least for me). And I have the nozzle coming up to temperature during the probing. That works out pretty good for me.

  6. #6
    Engineer-in-Training gmay3's Avatar
    Join Date
    Mar 2014
    Location
    USA
    Posts
    388
    Add gmay3 on Thingiverse
    Quote Originally Posted by Roxy View Post
    There was somebody here exploring the possibility of saving the bed correction matrix in the EEPROM so it doesn't have to be constructed at the start of each print. I don't know where in the process that work is. Or if it will see the light of day. It really isn't that hard to do. All the support routines for the EEPROM and default settings is in place to do it.
    Interesting. I was under the impression that the EEPROM has a more limited number of writes/rewrites then typical memory and that it should only be used when necessary for permanent value changes, but I could be totally wrong! I don't even know if the RAMPS has another type of memory.

    Quote Originally Posted by Roxy View Post
    So right now... You just do a G28 and a G29 at the start of each print and the correction matrix is generated and used during the entire print. I have my Slicer Start Up GCode wait until the bed is up to temperature before doing the probing. That seems to help accuracy (at least for me). And I have the nozzle coming up to temperature during the probing. That works out pretty good for me.
    So could one bake the G28 and G29 into the start up GCode after the bed has reached its desired temp?

    I'm guessing this is a non-issue but does the probe switch ever show signs of melting with the heat from the bed?

  7. #7
    Staff Engineer printbus's Avatar
    Join Date
    May 2014
    Location
    Highlands Ranch, Colorado USA
    Posts
    1,437
    Add printbus on Thingiverse
    The Atmel AVR MEGA microcontroller chips are specified at 100,000 EEPROM writes. FWIW - I haven't dug into Arduino to see what code they're using, but the WinAVR software originally used as a starting point for Arduino has an EEPROM 'modify' function that first checks the current value in EEPROM, and will only actually do a write if the new data differs. In other words, if Arduino is doing it right, people aren't actually writing to EEPROM as often as they think.

    Types of memory available in the AVR Mega microcontrollers are flash, static RAM, and EEPROM. Typically, flash is considered for permanent stuff like the executable code, menu strings, and other stuff that won't change. Static RAM is used for variable storage and stack space at run time, and has no retention. EEPROM is usually used to save user-selected parameters at run-time. The amount of each of these varies with the AVR device. For the ATMEGA2560 used on the MakerFarm Arduino board, you get 256K bytes of flash, 8K bytes RAM, and 4K bytes of EEPROM. Flash is good for 10,000 writes.

    ------------

    I've also been following the various bed leveling threads. I haven't implemented it, but it seems to me that beyond the hardware mod, a general list of recommended pre-requisites is the following.

    • You need to be comfortable with downloading, building, and uploading new firmware to your printer
    • You'll need either code from dacb's fork or the github Marlin base
    • The updated code will also require a newer version of the Arduino IDE. New code won't compile in the fairly ancient Arduino 022 IDE distributed by MakerFarm. I don't believe, however, that you want to necessarily jump to the newest IDE that is available.
    • You should be familiar with and comfortable with manipulating the start gcode in your slicer. Become familiar with the gcodes currently used in your slicer's start code.
    • You should be comfortable with the contents of the configuration.h file and how the various parameters are used
    • You should have at least a basic understanding of C/C++ code syntax, especially in use of switch cases, #define, #ifdef, and #endif. This may be invaluable should you run into compiler errors.
    • You should already be aware of info in various auto-leveling threads on this board


    As dacb's fork matures, the criticality of these should diminish. Well, at least the one on having some software knowledge.
    Last edited by printbus; 09-25-2014 at 12:07 PM.

  8. #8
    Technologist Tachout's Avatar
    Join Date
    Jun 2014
    Location
    Sandy Utah
    Posts
    119
    In reading the Pre-Requisites above I would say I can probably not do this, but I am not going to let that discourage me. I know nothing of C/C++ Code and most of everything up there is greek to me. I did take CNC Programing in college, and I sit in front of a CAD System all day so drawing is something I do each day. I figured that a 3d printer was a logical step for me, and so far I am really enjoying it. Getting the knowledge for the above and learning it is something I look forward to. Each year I set forth an education goal for myself, and try to complete as much as I can. Once you stop learning those that continue to learn will pass you by. I feel that this is something I can learn to do, and have had many offers on this board to just jump into it and if there is a problem to get on here and ask questions. We will see how it goes with someone that knows basically nothing of these prerequisites. I can download, and have no idea of building and uploading new firmware to my printer, but it cannot be that hard. I can get the code from dacb and github so that should not be that hard. Getting the newer version of Arduino IDE should not be hard if I go look for it. I am somewhat familiar with G Godes, and am learning my slicer fairly well. As for being comfortable with the contents of configuration.h file and its parameter....well that I am going to have to learn. Like I stated earlier I know nothing of c/c++ but am more than willing to learn. I do plan before beginning any of this, to read or reread all the auto-leveling threads on the board. Any other places I can learn from? I really want to make this work on my printer, and want to make my printer perform to its best.

  9. #9
    Staff Engineer printbus's Avatar
    Join Date
    May 2014
    Location
    Highlands Ranch, Colorado USA
    Posts
    1,437
    Add printbus on Thingiverse
    I added a zero to the number of available EEPROM cycles. Sorry about that.

    Tachout, the prerequisites are just my opinion based on what I've been seeing people running into issues with. Some of the auto-leveling threads may have their own versions of the prerequisites - I only started following the threads a ways back and haven't had the time to read some from the beginning. Roxy has been adamant - there's no one that hasn't eventually been able to get the autoleveling working. It's just been more frustrating for some than others.

    My recommendation to you would be to start with simple replication of the firmware you already have on your printer, using the Arduino 022 environment. Work through the process of the compile ("verify" in Arduino terms) and uploading it to the printer. That way you pretty much know the firmware should work, and you can just focus on the process to get it there.

    Once you have the upload process figured out, then maybe take a look at the minor firmware personalization post in my build thread. Perhaps there's one or two of those tweaks that you can incorporate into and witness in your firmware baseline, just as an incremental step forward in the learning process. That, along with reading some of the changes involved in auto-leveling, will get you familiar with at least parts of the configuration.h file. That's a very important file - it's where many critical parameters related to your printing are defined. It sort of serves as the cornerstone for the printer firmware. When something doesn't make sense, research or ask questions about it.

    FOLLOWUP COMMENT: And yes, 3d printing does provide a great opportunity for learning. Almost in a fascinating way. It involves an unusual combination of materials science, mechanics, electronics, and software programming.
    Last edited by printbus; 09-25-2014 at 12:45 PM.

  10. #10
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    ooops... I started this post before lunch... And then just finished it. I didn't see that everybody else had jumped in!

    Quote Originally Posted by gmay3 View Post
    Interesting. I was under the impression that the EEPROM has a more limited number of writes/rewrites then typical memory and that it should only be used when necessary for permanent value changes, but I could be totally wrong! I don't even know if the RAMPS has another type of memory.
    It is limited in the number of erase cycles that it can do... But it is guaranteed to be up around 10,000 or so. Probably way more. And the whole intent of doing this is so you don't have to do the probing at the start of each print. So until your bed gets too far out of kilter, you would not re-probe and save the new settings. You would just keep using the previous bed level correction matrix.

    Quote Originally Posted by gmay3 View Post
    So could one bake the G28 and G29 into the start up GCode after the bed has reached its desired temp?
    Yes. That is what is done. This is what my Slicer Start GCode is:

    G1 Z15 F2000 ; lift nozzle
    G28
    G29 v4 n3; Do bed leveling probe
    G1 Z15 F2000 ; lift nozzle

    Quote Originally Posted by gmay3 View Post
    I'm guessing this is a non-issue but does the probe switch ever show signs of melting with the heat from the bed?
    No... The plastic roller I have on my super cheap micro-switch is just fine. I suspect the plastic doesn't melt until a much higher temperature. But it is only touching for an instant. And the bed is at a much lower temperature than the nozzle. I do get a little bit of a coating of hair spray on it however!
    Last edited by Roxy; 09-25-2014 at 12:36 PM.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •