Per-Channel Tare Counts + Fixes & Improvements#894
Open
garethky wants to merge 4 commits into
Open
Conversation
garethky
force-pushed
the
pr-per-channel-tare
branch
from
June 22, 2026 16:46
c61d18a to
15b128b
Compare
garethky
force-pushed
the
pr-per-channel-tare
branch
from
July 7, 2026 04:14
15b128b to
c426428
Compare
This change records tare-counts per channel for multi-channel sensors. Commands like LOAD_CELL_READ will now show a list of individual force values for each sensor channel in multi-channel setups. Signed-off-by: Gareth Farrington <gareth@waves.ky>
* Sum the results of tare to send to the MCU * Fix the bug with the safety limit force not bing calculated relative to the reference_tare_counts Signed-off-by: Gareth Farrington <gareth@waves.ky>
Add a calibration mode that just updates the reference tare counts without going through the guided calibration helper. Signed-off-by: Gareth Farrington <gareth@waves.ky>
Allow the pullback move to be disabled on individual probes or features by checking for it in gcode commands Signed-off-by: Gareth Farrington <gareth@waves.ky>
garethky
force-pushed
the
pr-per-channel-tare
branch
from
July 14, 2026 22:57
c426428 to
01a9aac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This little branch has turned into kind of an omnibus. Lets get into it:
Better Multichannel Sensor Support
The first commit is all about making multi-channel sensors a first-class experience. Now the tare and reference tare values are stored as arrays of values, one for each channel. Force and counts of each individual channel is also emitted to the printer object and the websocket. This allows for deeper inspection of individual channels to look for saturation errors.
When using a multichannel sensor, all of the gcode commands now display data from the individual channels as well as the summation of the force from all channels. This will help users debug issues in multichannel setups. E.g. showing what happens when weight is applied to extreme corners of a multichannel under bed setup.
There was a lot of duplicated code for displaying force and for handling column identification in the sensor data. So I refactored it to use a more object oriented and declarative approach.
There was a bug in
load_cell_probe.pythat was displaying force incorrectly when the safety limit was violated. This was root caused to using the wrong tare value to calculate force. The newZeroReferenceenum explicit explains what reference will be used when calculating and displaying force. Everywhere that calculates or displays force now explicitly passes its zero reference.ForceReporternow centralizes the job of printing force to the console. A 4 channel sensor might report force from LOAD_CELL_READ like this:The
SampleStructureEnum now describes the columns present in a load cell sample and makes finding the column index for a specific channel easy. No more magic 🪄 numbers in the code.This is all backwards compatible with the existing interface. Everything new is being added onto the end and everything that already existed is still there. If we dont like the new structure and want to pack the channels one after another, I'm OK with making that change. Just let me know your preference in the review.
Future work
The tare value sent to the on MCU endstop is still just a single value. But we could send the tare value of each individual channel. This might help in detecting probes at the corners or edges of a bed where cantilever effects could potentially cause force cancelling between pairs of channels. Summing the absolute delta from each channel would cause these cases to be amplified. Supporting 4 channels is probably enough for our printers, so the command could have a limited size.
We just need to gather feedback for testers before prioritizing this work.
LOAD_CELL_CALIBRATE TARE=TRUE
The next commit is an update to how
LOAD_CELL_CALIBRATEworks. You can now runLOAD_CELL_CALIBRATE TARE=TRUEand thereference_tare_countswill be updated. This is the equivalent of "homing" the load cell.Users can call
LOAD_CELL_CALIBRATE TARE=TRUEat a point in theirPRINT_STARTwhen they know that the load cell does not have any force applied to it. e.g. after a Z lift, after nozzle heating etc.E.g here the load cell starts up at a load of 1kg:
This solves for some persistent issues we have seen in testing:
How it's supposed to work
reference_tare_countsis the calibrated 0 of the load cell.force_safety_limitis a limit relative (+/-) to that 0 point. This is checked before probing starts. Probing at forces outside the safety limit raises an error. This is in place because we don't have any other safeguards to prevent crashes. This is the same idea as "probe triggered before movement" in other probes.Real world ways the safety limit can be violated
What we found in testing
We see lots of false violations of the safety limit which users find frustrating:
With all of these issues its hard to find an ideal reference value.
How this is solved elsewhere
Prusa's firmware uses stall detection to stop a probe when the toolhead crashes. That requires stall detecting stepper drivers and steppers that work well with stall detection. So that's not a universal fix for all printers.
Tradeoffs
LOAD_CELL_CALIBRATE TARE=TRUEsets the zero reference point. This has the potential to allow bad things to happen:In those cases you'll defeat the safety system and potentially suffer further machine damage. So by running this you are asserting that neither of those things can be true.
Future work
I know that if you give users a way to "fix" a problem they will just run it all the time and ignore the underlying issue. Adding a second safety sensor, like stall detection, would be a good solution for most users.
disable_pullback_move on gcode commands
The last commit is a small change to allow the pullback move to be selectively disabled for individual probes or other commands. e.g. you want to probe a nozzle wiper pad and leave the nozzle in contact with the pad.
Checklist