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:
#defineBABYSTEPPING#ifENABLED(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!#defineBABYSTEP_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#defineBABYSTEP_MULTIPLICATOR_Z10 // (steps or mm) Steps or millimeter distance for each Z babystep#defineBABYSTEP_MULTIPLICATOR_XY1 // (steps or mm) Steps or millimeter distance for each XY babystep#defineDOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.#ifENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)#defineDOUBLECLICK_MAX_INTERVAL1250 // 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.#ifENABLED(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#defineBABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping#ifENABLED(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.
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.
Set the fade height to 4mm (4mm is from the Makertech configuration)
G29 F 4.0
Activate the UBL system
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.