I write "advanced" but that doesn't mean this discussion isn't for the uninitiated or those who have just started printing. I hope this discussion can be an in-depth and beyond-the-basics type of topic.
Let me state up front that I own another printer with a BLTouch probe and have been working with it and a BTT SKR 1.4 Turbo board to level an Ender 3 Pro. Most of my knowledge of the Marline firmware and bed leveling come from the setup of this probe and printer.
Current State of Bed Leveling with the Makertech Axis
The AXIS printer uses an inductive probe with a PNP normally open transistor switch. This probe will close or trigger when it is at 4mm from a metal object. Materials commonly used as build surfaces which are not conductive, such as masking tape, glass, etc, will not be detected by this probe.
In the Configuration.h file that is provided by Makertech ABL (automated bed leveling) is configured to use a 20 point grid in a 5, 4 configuration to achieve leveling using the bilinear method. The bilinear ABL configuration is, from my observation, the most common way to use a probe to create a mesh of the height of the bed at various points. The printer's firmware alters the z-axis height according to this mesh to produce a uniform set of initial layers onto the build surface. The limit in height that this mesh affects the z-axis is known as the Fade Height. The amount of leveling applied is gradually faded until this height is reached where the printer will then assume the print is level. The Fade Height is adjusted with g-code and is set to 4mm. The g-code for the AXIS printer is found in the printer profile in Cura, M420 S1 Z4.
In the Marlin firmware there is a setting RESTORE_LEVELING_AFTER_G28. Having this defined (uncommented) means that after the printer does its homing routine that the bed leveling mesh is restored. With the current configuration of the Marlin printer a leveling g-code command is sent to the printer, G29, which causes the bed to be probed and the mesh stored. During printing a G28, home the printer, command is sent followed by the Fade Height command.
Questions and Thoughts on Current Configuration
I have had a few thoughts on the current configuration of bed leveling that I was hoping we could discuss. These are mainly around the g-code sent to the printer.
First, I'm new to an inductive probe. With a probe such as a BLTouch physically touching the surface I find it important that the bed leveling mesh be generated often as a bed's surface can change over time. Since our beds are most likely covered by some non-conducting material it doesn't make as much since to do this. However, I still feel that a pre-print leveling routine should be performed. I have added a G29 command after the G28 command in the printer's configuration within Cura.
Next, since the mesh is reloaded after G28 and the G29 command comes after it I do not believe the Fade Height command is necessary. This value can be set once via Pronterface or the LCD and then stored in the EEPROM. It should be recalled automatically. Therefore, I've removed it from the slicer's configuration of the printer.
Something I've noticed, and this is where I'd like feedback, is that I can see a valid mesh get returned by the G29 command, I can see the z-axis move during the print, but I don't feel like it is correct or by enough. There are spots on my bed that I know the nozzle will hit even after a level command. What I don't know is if this is caused by the non-conductive surface on the flex plate. I can also see this on my other printer which has a similar configuration. Is there some incorrect assumption that I made above? Please share your thoughts.
Improvements to the Current Firmware Configuration
There are several configuration changes that I feel make the process of getting a level bed much easier. Some of these will require the LCD to be installed on your printer in order to take full advantage of the feature.
Babystepping is a change that is probably helpful to all users which have the LCD installed. Here's the comments from the Marlin firmware: "Babystepping enables movement of the axes by tiny increments without changing the current position values. This feature is used primarily to adjust the Z axis in the first layer of a print in real-time." What this is essentially saying is that you are able to adjust the nozzle height from the bed using your LCD and knob.
The configuration of babystepping is done in the Configuration_adv.h file. The following is an example of a configured babystepping section:
#define BABYSTEPPING #if ENABLED(BABYSTEPPING)   //#define INTEGRATED_BABYSTEPPING         // EXPERIMENTAL integration of babystepping into the Stepper ISR   //#define BABYSTEP_WITHOUT_HOMING   //#define BABYSTEP_XY                     // Also enable X/Y Babystepping. Not supported on DELTA! #define BABYSTEP_INVERT_Z false           // Change if Z babysteps should go the other way   //#define BABYSTEP_MILLIMETER_UNITS       // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps #define BABYSTEP_MULTIPLICATOR_Z 10       // (steps or mm) Steps or millimeter distance for each Z babystep #define BABYSTEP_MULTIPLICATOR_XY 1       // (steps or mm) Steps or millimeter distance for each XY babystep #define DOUBLECLICK_FOR_Z_BABYSTEPPING  // Double-click on the Status Screen for Z Babystepping. #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) #define DOUBLECLICK_MAX_INTERVAL 1250   // Maximum interval between clicks, in milliseconds.                                             // Note: Extra time may be added to mitigate controller latency.     //#define BABYSTEP_ALWAYS_AVAILABLE     // Allow babystepping at all times (not just during movement).     //#define MOVE_Z_WHEN_IDLE              // Jump to the move Z menu on doubleclick when printer is idle. #if ENABLED(MOVE_Z_WHEN_IDLE) #define MOVE_Z_IDLE_MULTIPLICATOR 1   // Multiply 1mm by this factor for the move step size.     #endif   #endif   //#define BABYSTEP_DISPLAY_TOTAL          // Display total babysteps since last G28 #define BABYSTEP_ZPROBE_OFFSET          // Combine M851 Z and Babystepping #if ENABLED(BABYSTEP_ZPROBE_OFFSET)     //#define BABYSTEP_HOTEND_Z_OFFSET      // For multiple hotends, babystep relative Z offsets     //#define BABYSTEP_ZPROBE_GFX_OVERLAY   // Enable graphical overlay on Z-offset editor   #endif #endif
Unified Bed Leveling - UBL
There exists a more advanced method of leveling the bed, UBL. Unified bed leveling is described in the Marlin firmware as "a comprehensive bed leveling system combining the features and benefits of other systems. UBL also includes integrated Mesh Generation, Mesh Validation and Mesh Editing systems."
The idea of UBL is to make a very, very detailed mesh of the bed. By default it will try to probe 100 points. This mesh can then be manually adjusted and then validated through a special print. When the printer goes to print it loads this mesh and can then be instructed to pick a few points for validation. This will help adjust the mesh if minor changes have occurred.
The steps for enabling and configuring UBL are much more involved than the bilinear setup that is enabled by default. The first thing which is necessary is to change the configuration in the firmware.
Enable UBL in Configuration.h by uncommenting "#define AUTO_BED_LEVELING_UBL" and commenting out bilinear "//#define AUTO_BED_LEVELING_LINEAR". Next you'll want to enable the G26 mesh validation tool by uncommenting "#define G26_MESH_VALIDATION". For an ultra-precise grid you should validate that "#define GRID_MAX_POINTS_X 10" is set.
If you have an LCD I highly suggest configuring babystepping as shown above.
Once you've compiled the firmware and sent it to the printer it is then necessary to perform the initial calibration of the mesh. If you have an LCD you will likely stumble onto the UBL configuration section. There is a procedure in the menu for creating, editing, and validating the mesh. I have never been able to successfully use these menu options. Beware that it is possible for the printer to be put into a state where the nozzle will collide with the bed. I do not know if this is because of how z-offset is factored in or if there are bugs. I suggest using Pronterface to send the commands manually.
I have found the best way to configure UBL is through following the commands in Marlin's topic on UBL: https://marlinfw.org/docs/features/unified_bed_leveling.html#synopsis In the Synopsis section is a box showing the g-code for initializing, fine tuning, and validating the mesh. It basically works like this:
After sending the firmware to your printer you should reset things.
M502 ; reset EEPROM
M500 ; save EEPROM
M501 ; load EEPROM
Prepare the printer for initial mesh creation. The printer should be brought to typical printing temperature.
M190 S65 ; heat the bed
Home the printer
G28 ; must be performed before other commands are issued
Perform the initial mesh creation
G29 P1 ; Probe the bed
After the automated probing is completed it will likely be the case that there are points in the mesh that couldn't be probed.
G29 T ; print the current map, there will likely be a bunch of 0,0 entries
G29 P3 T ; smart fill empty points and print the map. if there a bunch of 0,0 entries this should be run until all are filled in
Save the mesh to slot one. There are multiple slots if you have multiple build surfaces you wanted to level.
G29 S1
Set the fade height to 4mm (4mm is from the Makertech configuration)
G29 F 4.0
Activate the UBL system
G29 A
Save the configuration to EEPROM
M500 ; Save current setup. UBL will be active at power up, before any G28. (Which is what we want)
Before you print the validation mesh get your z-offset set (remember you cleared your settings after the firmware was flashed)
Print the validation mesh
G26 L0.2 B60 H200 S0.3 ; Prints mesh with a layer height of 0.2mm, bed heated to 60, hotend to 200, and is using a 0.3mm nozzle.
If after you print the validation mesh you have bad areas you'll need to adjust them. I haven't had to do this, but following the guide in the link should get you there.
In your slicer you'll want to edit the printer so that you can change the g-code that's executed before the printer starts printing the model. This is referred to as the "start g-code" in many slicers. After the G28 command we no longer need the M420 command, it can be removed. During our setup we activated the mesh and in the firmware the mesh should be loaded after G28, but it is good to add in "G29 L1 ; Load the mesh stored in slot 1 (from G29 S1)" after the G28. Next, it is a good practice to quickly check 3 points on the build surface to help modify the mesh for small deviations. Follow the previous command with "G29 J ; Probe 3 points for mesh alteration". You can modify the command by appending an integer after "J" to define more than 3 points if you wish. Generally, 3 should be enough but if you wanted to do more you're only adding to the time before the actual printing starts.
This should get your UBL system up and running. Hopefully the overall mesh, having more points, is more accurate. Adding the 3-point check before printing should help with any small deviations. Revisiting creating the mesh is necessary if any large changes to your build surface occur.
Where Do We Go From Here?
Hopefully this gives us a great starting point for discussing bed leveling for not only the AXIS printer but all 3D printers running on the Marlin (or derivative) firmware. I tried to best describe what the AXIS printer is actually configured to do and what it does. I've also tried to provide an example of a configuration change to help people with leveling their beds and talked about a different method of leveling the bed. The section on UBL should provide you with enough to get up and running with a much more comprehensive bed leveling technology.
I want to open up a discussion regarding the aspects of leveling. Please feel free to correct my explanations if they're incorrect. Also help clarify if things stills seem murky. I don't know everything but I am hoping that by talking among ourselves that we can all gain a better understanding of how this process works.
I tried this. I evidently just have no clue what I'm doing. My grid looked like this...
I wasn't even sure what to do with that. SOOOO...
I backed those config changes out and decided to increase the measurement points and increase the measurement points to 7x5 and added in 3 extra points between...
I meant to EXTRAPOLATE_BEYOND_GRID but forgot evidently.
#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. #define GRID_MAX_POINTS_X 7 #define GRID_MAX_POINTS_Y 5 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) // Beyond the probed grid, continue the implied tilt? // Default is to maintain the height of the nearest edge. //#define EXTRAPOLATE_BEYOND_GRID // Experimental Subdivision of the grid by Catmull-Rom method. // Synthesizes intermediate points to produce a more detailed mesh. #define ABL_BILINEAR_SUBDIVISION #if ENABLED(ABL_BILINEAR_SUBDIVISION) // Number of subdivisions between probe points #define BILINEAR_SUBDIVISIONS 3 #endif #endif
Anyway (wow, how do I get out of this color)... with this and BabyStepping I'm happy enough with the FlexPlate Heated Bed now. I'll post another thread with some result pictures.
Jay
@Johannes Helm 3 Things:
Are you using the magnetic flex plate? If so, you will have to be careful where you probe. If you probe directly over (or too near) a magnet, you will get a bad reading.
Make sure you heat up your bed when you probe, edit your mesh, and test for your z-offset. The heat can expand your bed, and the current running through the bed can induce magnetic fields that may affect the probe reading.
Use M851 instead of M206 to set your z-offset. M206 sets the offset for the entire coordinate space. M851 is specific to the z-probe. They have essentially the same effect; but, I think there might be some internal stuff in the UBL code that doesn't jive with M206.
...okay, 4 things... don't bother with G26. That whole thing is way too slow. Just make a simple 10x10x0.2mm cube, drop it into Cura, position it on the first UBL mesh point (nearest X:0, Y:0). There's a Cura plugin that will let you layout an object in a pattern. Just specify the spacing.
Better yet ... just use the "mesh edit" function on your LCD (assuming you have one). MOVE -> Unified Bed Leveling -> EDIT MESH. Scroll through the mesh points until you get to the one(s) that are bad. Then press the button. It will bring the nozzle down onto the selected point so can you manually adjust the mesh point with a piece of paper. It will make you adjust all the adjacent points as well. When you're finished, just select a point and click the button; but, instead of adjusting it, hold the button in. It will take you back to the info screen. Make sure you G29 S1 and M500 (or "save settings" on the LCD configuration menu). Oh, and you have need be sure UBL is active 1st. You can do that in the UBL menu or pronterface/octopi: G29 L1 (load mesh in slot 1); G29 A (activate UBL).
Doing G29 T in pronterface will show you a matrix for the mesh. It will show you where there are gaps the G29 P3 T will fill in the missing spots using "smart fill". The docs say that all 100 points might not be touched. This is ok.
Next make sure you save the mesh, G29 S1, then G29 F 4.0 to set the fade height. Activate UBL by G29 A and finally save it all with a M500.
When you G29 J in your code the default functionality is to probe three spots for bed skew.
The movements might seem smaller because your mesh is now finer. Visualizing it in Octoprint is the best way to see what's going on. You might have to change how the mesh bed visualizer gets the matrix with UBL. I haven't set it up.
My other printer is dead at the moment (shorted thermistor took out the board) so I can't really give a demo.
@Michael G First it probed only 57 points after setting the non probe are to 15mm it got to 91 points. As u move the Y axis to max u can see that the probe is unable to probe like 25-30 mm from the front side of the X axis.
is there a way to know if my UBL actually is working? In my slier i have removed the M420 command. I have G28 > G29 L1 > G29 J... before the print i can see printer probing 3 spots. But during print, at least for me it seems that the Z axis is moving less
Yet again i seek knowledge from Axis and Marlin wisemen. I managed to enable babystepping and UBL, even managed to get the pobe count from 57/100 to 91/100. But i got stuck in the last point
11 - Print the validation mesh -G26 L0.2 B60 H200 S0.3 ; Prints mesh with a layer height of 0.2mm, bed heated to 60, hotend to 200, and is using a 0.3mm nozzle.
to be more precise with the combination of the above and Z axis offset. As i print the validation mesh i can see that its not lowering the nozzle as low as Z axis offset is.
when i type "M501" in pronterface should i see from that data also Z axis offset?
First i tried to do the Z offset from the Axis itself and thought that was a problem, but then i also did it like Makerteh advises from pronterface but the outcome is still the same.
thanks, right now i downloaded the marlin file agian and started with configuration again. This time complying after every step. So far i got the baby stepping complyd. Will continue tomorrow. Why im doing this- i found that my bed is off more then 1mm with the fwd side of the bed being up and the gantry side being down :S
After enabeling baby stepping and ubl i cannot comply the marlin file. it says Error compiling for board Arduino/Genuino Mega or Mega 2560... did i messed up the file ?
have spent a lot of time trying to get this right combined with the heated bed, but I don't seem to fully understand it, I still get high and low spots on my bed when printing the first layer with such high differences that some parts the nozzle starts burying itself in the bed and on other parts the filament doesn't even stick... That combined with the X-axis motion has started to wear me down, already haven't touched the printer for a week now... Am wondering if I just started out with too many features...
Except for my really bad bed it is working fine for me. 8mm inductive probe will be here today. Will have to relevel after I install it and the glass bed.
So I finally got around to doing this. I managed to get a decent looking validation print. It was stringing all over the place, but there were only a few points that needed adjustment. (btw, add Q6.5 to the G26 command to correct the stringing) I saved everything with G29 S1; and again with M500.
When I turned on the printer the next morning to correct the few bad spots, suddenly it was mashing the nozzle into the bed at every point. It seems like it applied the z-probe offset (M851) twice.
That was yesterday. Today I tried the bug-fix-2.0.x branch of the Marlin firmware and had the same issue.
So has anyone else made UBL work?
maybe m206 instead of m851 ...
After enabling UBL and tweeking the edges and 2 trouble spots my prints look soooo much better now. Thank you so much for this thread.
Just a word of warning with UBL while it's running the mesh probing and you have the flex plate, make sure the flexplate is under the probe at the edges. Otherwise it will probe down to the plate and if a print gets anywhere near the edges it will gouge down into your flex plate.
The fade height setting will be disabled with the M420 S0 command (bed leveling off) so if you follow the procedure to do the Z-Offset correction after bed leveling the fade height setting will stay off as well. I think that's one of the reasons why the M420 S1 Z4 command is in the start G-code settings of the printer in Cura.
I'm currently still using the bilinear bed leveling but configured the grid to 7x5 instead of the original 5x4 mesh points. The denser grid provided some better results for me. I haven't tried UBL yet.
Edit: Correct M420 command (M240 is to trigger a camera)
That's quite a post, wow. Thank you.
I'll surely tinker with this in the near future. Then, I'll have to research some more before I can respond in full.