Bed leveling shim estimation from probe data

Updated 2026-06-11
CoreOne

The Core One's heatbed is mounted on three Z lead-screw mounts: front-left, front-right, and back-center. Bed tilt is corrected by placing shims between the bed plate and the mounts. The stock firmware has no routine to measure the mount heights and compute the required shim thicknesses. The community firmware adds a probe feature that measures the three mount points and recommends shim values.

How the bed is mounted

The bed plate sits on three mounting points. The relative heights of these points determine the bed's tilt:

Mount Position Approximate coordinates
Front-left Left front corner (MESH_MIN_X, MESH_MIN_Y)
Front-right Right front corner (MESH_MAX_X, MESH_MIN_Y)
Back-center Midpoint of back edge ((MIN_X + MAX_X)/2, MESH_MAX_Y)

The load cell in the nozzle already performs contact Z probing at any reachable point. The stock firmware uses this for adaptive mesh bed leveling but does not expose a way to probe the mount points and compute shim requirements.

The bed level probe feature

The community firmware adds M1962 (shim probing) and M1963 (grid probing), accessible from Settings → Advanced Calibration → Bed Level Probe.

Shim mode (M1962)

The shim mode probes the three mount positions and computes the required shim thicknesses:

  1. Home all axes
  2. Probe Z height at each mount position
  3. Record the relative height differences
  4. Display shim thickness recommendations

The three probe positions are the closest reachable points to the physical mounts:

constexpr NamedPoint screw_positions[] = {
    { grid_min_x, grid_min_y },      // Left front
    { grid_max_x, grid_min_y },      // Right front
    { (grid_min_x + grid_max_x) / 2.f, grid_max_y }, // Back center
};

The probe cannot reach the exact mount locations (they are under the bed), so it probes at the bed margin positions used in Prusa's own alignment procedure.

The results screen shows:

Grid mode (M1963)

The grid mode probes an 8×6 full-bed grid and displays a color-coded height map. The color interpolates from grey (closer to nozzle, lower Z) to red (further, higher Z), showing high and low spots across the bed surface. This is primarily a development and diagnostic tool.

FSM lifecycle

The probe runs as a finite state machine (fsm/bed_level_probe_phases.hpp):

  1. Intro — instructions and user confirmation
  2. Homing — home all axes
  3. Probing — sequential point measurement with progress counter
  4. Results — display data and shim recommendations
  5. Error — probe failure (dirty nozzle, load cell issue)

The FSM allows pause/cancel at any point and keeps the GUI in sync with probe progress.

Implementation

The feature is implemented in src/feature/bed_level_probe/:

The shim recommendation computes the height difference between each mount and the highest mount, then rounds to standard shim thicknesses:

// Height differences are in micrometers; round to nearest 0.05 mm shim
int32_t shim_um = ((max_z - mount_z) + 25) / 50 * 50;

References