Adjusting extrusion multiplier when Hall filament sensor is active

Basic Information:

Printer Model: HEVO
MCU / Printerboard: SKR Pro 1.2
klippy.log not relevant, it’s not about an error or a specific configuration.

Describe your issue:

The Hall filament width sensor (on my desk, not yet configured) (klipper/hall_filament_width_sensor.py at master · Klipper3d/klipper · GitHub and Hall filament width sensor - Klipper documentation ) works by setting the extrusion multiplier depending on the filament diameter, it issues M221 when in operation.

That’s ok in principle, but right now I use the EM to adjust flow of different filaments after doing the EM calibration (see Ellis’ guide), so that wouldn’t work anymore. I may also want to adjust the flow on the fly, if for some reason I notice it’s off.

So what can I do to retain the ability to manually adjust the flow multiplier, while using the Hall effect filament sensor?

In principle I thought about writing a macro which redefines the M221, so that the M221 multiplies the value received (by the filament module) by a variable I can control externally during print. This would work but then I need to type variable assignment commands manually.
Is there a way to show in Mainsail an extra slider which controls a user-defined variable? Then I could adjust that slider instead of the EM slider, which is already controlled by the filament module.

Being able to add sliders/switches linked to user variables would be useful also in other cases: for example, I am thinking of redefining M106 and SET_FAN_SPEED to discard the command if a user-variable “locked fan” is true.

Another option would be for the filament module to continuously redefine the rotation distance, leaving the user-facing EM parameter free. This would require a change of the source code, which I may even be able to do myself. Not sure whether the rotation distance would have instant effect, like the EM has, or if it is checked and applied only in specific cases (like initialisation, or similar).

Any comment on the topic?

1 Like

Hi, im having facing the same problem atm. Did you find any way to workaround for this?

Nothing yet but I’ll modify the module to change the rotation distance and I’ll push a pull request.
It may take weeks or months (no joke), depending on free time, so if you can do it, better do it without waiting for me

Sadly im not good enough with writing my own code/macros. Too much stuff i dont know where to find it or how i would even approach it :confused:

Even tho i have no idea how to implement it i have a idea how this could be implemented:
no idea if its really like this, so this is a hard guess…

Currently its working something like [requested flow] * [extrusion_multiplier] = actual extrusion
where extrusion multiplier is the variable which is changed by the width sensor

so why not add another variable to it:

[requested flow] * extrusion_multiplier * [filament_width_sensor_multiplier] = actual extrusion
so this way, the filament width sensor multiplier gets rerouted to another variable which is just a multipliert for the width, while remaining the real extrusion_multiplier to be manually adjusted from the webinterface which defaults too 100%

It’s easier to change the rotation_distance.

I’m not the person to have the final call but from experience, this change will hardly be accepted.
rotation_distance is a “hardware value”, i.e. it depends on the used hardware and is considered static with a given hardware.