BED_MESH_CALIBRATE - Unexpected behavior or outdated documentation

Basic Information:

Printer Model: Voron 2.4r2 350mm
MCU / Printerboard: BigTreeTech OctoPus V1 + EBB 2209 connected via U2C V2.1
Host / SBC - pi4 Host (aarch64, 32bit)

Version: v0.12.0-132-ge37b007f-dirty

OS: Raspbian GNU/Linux 11 (bullseye)

Distro: MainsailOS 1.2.1 (bullseye)

Describe your issue:

before adaptive mesh was added into klipper, I had KAMP and I use to have the start_print macro something like this:


[...]
   BED_MESH_CALIBRATE 
   BED_MESH_PROFILE LOAD=default
[...]

And the result was a profile named default that it would load using the command.
Now I added the adaptive=1 parameter and no longer use the KAMP adaptive_mesh.cfg.

The documentation says that when BED_MESH_CALIBRATE occurs it saves a “default” profile and it would not load unless BED_MESH_PROFILE LOAD=default.

Now it seems it saves a profile named adaptive-F60383A0 and it loads it automatically. I tried running:

BED_MESH_CALIBRATE PROFILE=adaptive_profile ADAPTIVE=1
BED_MESH_PROFILE LOAD=default

But the same behavior occurs. then I also noticed the save=[name] parameter. I did not tested it yet. Does the save creates a new one, and the profile updates an existing one? I don’t get it from the documentation.
klippy.log (3.1 MB)

You appear to have misunderstood the documentation. BED_MESH_CALIBRATE has always applied the probed mesh immediately, so calling it and then calling BED_MESH_PROFILE LOAD is pointless. It also, when you are not using adaptive meshing, saves the mesh (either as default or the value of the PROFILE parameter), allowing you to call BED_MESH_PROFILE LOAD at any point in time to load a mesh from the config file without performing any probing.

When the documentation says “Previous versions of bed_mesh always loaded the profile named default on startup if it was present” it is referring to this loading of a saved mesh from the config file, which used to be automatic on Klipper startup but now must be done explicitly.

https://www.klipper3d.org/Bed_Mesh.html

After a BED_MESH_CALIBRATE has been performed, it is possible to save the current mesh state into a named profile. This makes it possible to load a mesh without re-probing the bed. After a profile has been saved using BED_MESH_PROFILE SAVE=<name> the SAVE_CONFIG gcode may be executed to write the profile to printer.cfg.

Profiles can be loaded by executing BED_MESH_PROFILE LOAD=<name>.

It should be noted that each time a BED_MESH_CALIBRATE occurs, the current state is automatically saved to the default profile. The default profile can be removed as follows:

BED_MESH_PROFILE REMOVE=default

Any other saved profile can be removed in the same fashion, replacing default with the named profile you wish to remove.

Loading the default profile¶

Previous versions of bed_mesh always loaded the profile named default on startup if it was present. This behavior has been removed in favor of allowing the user to determine when a profile is loaded. If a user wishes to load the default profile it is recommended to add BED_MESH_PROFILE LOAD=default to either their START_PRINT macro or their slicer’s “Start G-Code” configuration, whichever is applicable.

Alternatively the old behavior of loading a profile at startup can be restored with a

Yes. That’s the documentation that I just explained to you. Did you have another question?

I see. how about the name of the profile that gets generated after bed mesh? is it normal to get saved under adaptive-F60383A0 instead of default?

Adaptive meshes were originally intended to be nameless and ephemeral, but the existing frontends didn’t cope well with that so now they get a randomized placeholder name. This should probably be noted in the documentation, but isn’t.

Every time BED_MESH_CALIBRATE is performed it temporarily saves the profile. The default behavior is to save it to a profile named default, however this name can be overridden. Adaptive meshes get unique profile names so they can be identified. As flowerysong stated, it was originally done accommodate frontends, however it can also be used in macros to identify adaptive meshes. For example, you could create a macro that does adaptive purging when the profile name starts with “adaptive-”.

You “can” save adaptive meshes, however it isn’t recommended unless you are looking to troubleshoot one and/or perform some kind of analysis.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.