This is a post regarding my recent PR (#6018)
If anyone wants to test this I’d be happy to assist.
Just wanted to share my current implementation of load cell probing as there seems to be a lot of interest in the feature.
I know there is already a PR regarding this (#5623) however my implementation is different in that it uses one continuous approach instead of moving in small steps. This is quicker and also enables homing with just the load cell.
In its current state the implementation works well on my printer, however it hasn’t been broadly tested, and my setup uses a very nonstandard version of klipper. So it’s possible i have overlooked something when creating the PR.
needs numpy (I think this makes these things a lot more readable, maybe it can be installed manually for now)
doesn’t support multi-mcu homing (not sure how easy this is to implement or if it is needed, fundamentally there is less room for overshoot/latency as the printhead is already under tension at the end of a homing move)
not tested with delta printers
no support for multiple load_cell adcs
How to test this
you need a printer with a hx711 load cell adc
you need to install numpy
you need to to use python3
use a different retract distance for probing/homing (i think there is a bug with manual_move when commanding a move to the current position)
tune the direction, force_threshold, and homing/probing speeds. (my printer uses 3 load cells in parallel, so the 70000 threshold is probably wrong for other printers)
It’s probably easiest to test homing first. For this a homing move can be started whith the z axis far away. Pressing the load cell by hand should stop the z axis. Additionally it may be a good idea to reduce the z axis curent when testing this, to prevent breaking the load cell if there is a problem with the configuration.
The added [load_cell_probe] and [hx711] sections documented Config_Reference.md should include everything needed to set this up.
Thanks, this is very interesting. As Kevin pointed already out on Github, I am using load cells in a very similar way for some time now, although I have to admit that the Klipper integration is still incomplete due to lack of time on my end (I will continue working on this soon, hopefully).
The question which pops up immediately: What is the absolute precision you can reach with this? Load cells require naturally a force which is normally not negligible. The printer mechanics will bend a bit under that force. In my experience this spoils the results, at least if you expect precisions below 0.1mm. Of course this will depend on the printer model and load cell type.
Have you done any measurements to estimate this effect? A simple method to do so is to measure carefully (!) the relationship between your load cell readout value and the z distance once you have established bed contact. This should be somewhat linear. The slope can be quite different at various places across the bed, because the bed will bend and tilt differently depending on where you apply the force.
With such measurement, you can determine how much your printer has moved the nozzle “into” the bed at the threshold of e.g. 70000 digits, and how much this distance might vary across the bed.
I would also recommend to determine roughly a calibration to physical units, i.e. measure how much force/weight 70000 digits correspond to. This may be interesting for finding out whether this force is safe to apply. This is also quite simple if you just take a known weight of a few 100 Grams or so and attach it to your printer such that the weight is measured by the load cells (if the load cells are in the bed support, just place it on the bed; if the load cells are in the hotend support, tape it to the hotend - always compare with and without the weight and take the difference of course).
Finally, what about temperature drifts? I have seen the base line (measurement without any force) wandering by quite a lot when heating up the printer bed in my printer. This can create issues with a static threshold, obviously.
Thanks for the feedback.
First of all I think the position calculation is not so different from your implementation. The stiffness value is recalculated every time as well as the baseline.
The threshold shouldn’t impact the result, therefore a fixed value is used. This is the safest approach for now. Maybe this can be applied relative to the calculated baseline in the future. However in my testing the drift wasn’t high enough for this to make sense.
Using physical units would be nice, however if the load cell is in the printhead you would have to tie a string with a weight to this for calibration.
To simplify the tuning of the threshold value we could log the physical deflection after every sample. Then one could easily tune the threshold value to reach a reasonable deflection of e.g. 0.2mm
Very interesting, I will check this out rather soon!
It depends on the exact geometry of course. I just stuck a random aluminium bar I had at hand with painters tape to the lower end of the hotend. It doesn’t have to be super precise, just to get some rough idea. Load cells have a maximum rated force, mine are 5kg, so the question is whether the threshold might come close to that maximum force or is sufficiently far away.
Did you build your own load cell or are you testing on an existing printer? I am asking because I want to integrate this into my printer, but was thinking it might be easier to help out in this implementation by getting a used machine that has a built-in strain gauge first.
I am using a custom printer, with three 5kg load cells below the printbed (they are connected in parallel to one hx711 board).
I have another printer where the printhead is mounted to a single 5kg load cell.
I think this should be easy to rig up on most printers. (with the hx711 boards a small wire needs to be soldered to put them into 80 samples/second mode)