Skip to content

Load Cell Probe Calibration Tools - #876

Open
garethky wants to merge 6 commits into
KalicoCrew:mainfrom
garethky:pr-load-cell-calibration-tools
Open

Load Cell Probe Calibration Tools#876
garethky wants to merge 6 commits into
KalicoCrew:mainfrom
garethky:pr-load-cell-calibration-tools

Conversation

@garethky

Copy link
Copy Markdown
Contributor

These are the 3 calibration tools that are mostly finished. This gives users a method for finding values for some of the trivky but essential settings for the load cell probe:

  • CALIBRATION=DRIFT_FILTER - this calibrates the drift filter frequency setting used to eliminate load cell force drift caused by bowden tubes. It does this by tapping into the machnies bed mesh configuration. It visits each mesh point and moves the toolhead from the top of the machines build volume down to 10mm above the build plate. The force data is collected and the minimum filter frequency needed to eliminate the observed drift is calculated. This measurement is repeated for every mesh point and the peak value is reported as the optimal drift filter value.

  • CALIBRATION=PULLBACK_DISTANCE - The pullback distance is the distance that the toolhead lifts when performing Tap Analysis. This distance needs to be tuned based on the observed machine characteristics. Less stiff machines, and machines with slower sensors have more overshoot at the maximum probing speed. Using too large of a value is slow, so we want to minimize this value while allowing probes with the highest amount of overshoot to succeed. This calibration performs a bed mesh with a very large pullback_distance value at the maximum configured probing or homing speed. It looks at the position of the elbow in all of the pullback moves and tries to optimize such that there is enough pullback distance in the worst case.

  • CALIBRATION=DECOMPRESSION_ANGLE - This performs a standard bed mesh pattern at the standard probing speed and calculates the average of the decompression angle value. This setting is required to enable Tap Quality checking.

Checklist

  • pr title makes sense
  • added a test case if possible
  • if new feature, added to the readme
  • ci is happy and green

@EllaFoxo

EllaFoxo commented May 5, 2026

Copy link
Copy Markdown
Contributor

These tools are great. Noticed during the pullback distance calibration, the reading for force is in standard form/notation. Probably ought to output a decimal.

Decompression distance: 0.0359mm, force: 2e+02g

@garethky

Copy link
Copy Markdown
Contributor Author

One critique that I can think of is CALIBRATION=DRIFT_FILTER may not require the Z axis to move at all. The Z axis moving is only useful if its going to impact the drift filter by somehow imparting a force on the load cell.

Where it matters:

  • Gantry machines like the Voron 2.4 with a toolhead load cell
  • Moving bed machines where the load cells are under the bed

Where it doesn't matter:

  • Machines with a static bed with load cells under the bed (e.g. Voron 2.4)
  • Machines with a toolhead that doesn't move in Z (e.g. Voron Trident)

In the case where it doesn't matter we still want to capture some data as the movement of the toolhead is going to cause forces on the bowden tube that show up as drift that needs canceling. In that case we would need to capture some amount of data (2 seconds?). But this would be a MUCH faster calibration run on those machines.

I don't know of a way to decide which case is which from the printer config. But I could provide an argument to the command to disable Z motion.

@rogerlz

rogerlz commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Reviewed this one. The CI failure is just a broken docs anchor, Load_Cell.md#tap-quality-calibration does not exist. But I found some real issues too:

  • DriftFilterCalibration reads [printer] max_z_velocity and [stepper_z] at config time. That breaks startup for deltas and for configs without max_z_velocity. Better to resolve those at calibrate() time.
  • The two gcmd.error(...) calls are built but never raised, so an unknown CALIBRATION value silently does nothing.
  • TapQualityClassifier leaves _calibrating=True if probing fails, and min([]) crashes when no taps are valid.
  • MAXIMUM_Z_POSITION is parsed but the moves use the config value, and the docs say MAX_ACCEPTABLE_SLOPE while the code reads MAX_DRIFT_RATE.
  • The :.3 format specs print scientific notation, as Ella pointed out in May.

I can push fixes for these to your branch if that helps. Let me know.

garethky added 2 commits July 14, 2026 12:21
The calibration tooling needs to attach to the load cell probe events for data.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
This change allows callers to create tools that leverage the bed mesh config (e.g. for complex things like faulty regions) and GCode parameters without having to actually probe those points. The generated points can then be used for other purposes. E.g. to visit each point for a calibration routine.

Unfortunatly this changes the internal state of the bed mesh. The current code is not conducive to reuse. However on the next bed mesh call the state will be reset to whatever bed mesh the user specifies.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
@garethky
garethky force-pushed the pr-load-cell-calibration-tools branch from 5bd3fe7 to aab95e1 Compare July 14, 2026 22:57
garethky added 4 commits July 14, 2026 17:33
Set up a framework for registering load cell calibration routines.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
Collect data from toolhead motion to find the cutoff frequency required for drift free probing.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
Probe a mesh and calculate the pullback distance required for safe probing.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
Perform a bed mesh and measure the mean of the `decompression_angle`.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
@garethky

garethky commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Well spotted!

I'm going to push a fix for most of that and then look at the first issue:

  • DriftFilterCalibration reads [printer] max_z_velocity and [stepper_z] at config time. That breaks startup for deltas and for configs without max_z_velocity. Better to resolve those at calibrate() time.

How do you propose we solve that?

I've never run a delta on klipper so I'm not familiar with the start up sequence.

If there is no [printer] max_z_velocity what should we use? Really we want to know: whats the fastest probing or homing move you are going to run. Quite often the homing move speed is higher than the probe speed, so the probe speed probably isn't it.

@garethky
garethky force-pushed the pr-load-cell-calibration-tools branch from aab95e1 to 53b7313 Compare July 15, 2026 01:12
@garethky garethky mentioned this pull request Jul 15, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants