load_cell: Optional continuous tracking of loadcell measurements#7283
load_cell: Optional continuous tracking of loadcell measurements#7283dmbutyugin wants to merge 1 commit into
Conversation
| is calibrated a force in grams is also reported. | ||
|
|
||
| ### LOAD_CELL_TRACK_FORCE | ||
| `LOAD_CELL_READ [LOAD_CELL=<config_name>] [TRACKING=<START|STOP>]`: |
There was a problem hiding this comment.
Right, my bad, copy-paste from the wrong place.
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
|
My preference is to have it on by default. This is more like a temperature sensor because it has a status. Having it off just adds confusing hoops for the user to jump through to get it working. Positives:One use-case I can think of for this is if you have have multiple toolhead probes and you want just 1 on at a time. So this probably has to happen. (klipper cant do that, yet) Keeping the sensor on over long running set of tasks (like a print start or bed mesh) is beneficial. Programming the sensor registers, starting measurements and sensor settling time all... take time. (right now we ignore the settling time because the sensors are always running at startup) You wouldn't want to wait for that for every probe. So, for those two reasons, I endorse the idea of a command to keep thing on and turn them off. Not so good:It doesn't look like using any of the load cell gcodes ( It looks like all clients are disconnected when tracking stops. That could cause the front end to go into a re-connect loop or require some complicated reconnect logic for internal modules that want to monitor force. I would send a tracking started/tracking stopped message instead and allow the subscription to remain. If a web client connects and the sensor isn't tracking, just send it the stopped message. The message pump is event driven so this shouldn't add any overhead in the stopped state. Alternatives:What I would do:
Lower the sample rate: |
|
Thanks. For what it is worth, I don't think a new As Gareth mentions, the sensor reading would need to start automatically on a Separately, as a high-level observation, we may want to look at replacing Cheers, |
This PR changes the default behavior of
load_cellandload_cell_probeto not start tracking force after Klipper startup. This can be changed back via a configuration option, or enabled and disabled at runtime on-demand via a command. This can be particularly useful for fast-sampling loadcells as continuous sampling when not needed creates unnecessary load on the MCU and the host. And FWIW, this is an initial proposal and I'm open to suggestions on the command and configuration option names and such.@garethky FYI