Where is the calculation of flow that depends on the nozzle diameter displayed in the fluid?"

I need to change the flow in mm³/s that is displayed in Fluid, depending on the nozzle diameter. By default, the nozzle diameter data is taken from the printer.cfg file under [extruder] . I need to take it from a DIFFERENT file instead. How can I do this?"

Moved to the Frontends category.

Actually, I’m not sure if this is taken from the cfg file, as this information in the cfg is quite internal and targeted at some sanity checks and not the actual condition.
Maybe @pedrolamas can chime in.

1 Like

At the moment that is not possible.

As you very well put, Fluidd will use whatever nozzle_diameter is set on your [printer] config section (which can be on printer.cfg or any other file that is loaded in Klipper)

1 Like

Interesting.
I would have expected it uses the information from the actual gcode file, as the Klipper setting itself has no practical meaning except for the internal sanity checks.
I keep the Klipper setting at 0.8 for all purposes because I see no reason in modifying it between 0.4 to 0.8.

1 Like

So, if I get it the right way, Fluid takes Nozzle_Diameter not from printer.cfg directly, but load from object printer in Klipper, right?

Correct, but then again that specific value can only be set in the configuration files and is read once when Klipper starts!

1 Like

Fluidd ignores the nozzle_diameter metadata on the gcode file and will use the one set on each of the extruders defined on the configuration files.

I believe the same behavior applies to Mainsail.

2 Likes

Thanks for the clarification.
Is there a specific reason for it? I’d think the metadata is more representative (just for my understanding—neither one gives me much headache, as I see this “for information only”).

i have read through the complete thread again and i think that there is generally a “mix-up” going on here.

the nozzle_diameter is not important for the flow calculation. only the filament_diameter + extruder move is used here.

1 Like

I appologize for one more question,so I have a custom extra module, which uses extruder where nozzle_diameter unpack from bytes. If I modify kinematic/extruder.py in the following way (where class Cartridge_Reader is located in extras.py ), and the approximate changes in the code are:

import math
from struct import unpack

class PrinterExtruder:
    def __init__(self, config, extruder_num, cartridge_reader):
        self.printer = config.get_printer()
        self.name = config.get_name()
        self.last_position = 0.
        self.cartridge_reader = cartridge_reader

        self.nozzle_diameter = self._get_nozzle_diameter_from_cartridge()

    def _get_nozzle_diameter_from_cartridge(self):
        cartridge_info = self.cartridge_reader.get_cartridge_info()
        return cartridge_info['nozzle_diameter']

class CartridgeReader:
    def __init__(self):
        self.cartridgeinfo = {}

    def _fill_cartridge_info(self, channel, data):
        info = unpack('1y5k1I20h3g58b', data)
        self.cartridgeinfo[channel] = {
            'nozzle_diameter': info[1] / 100.0,
        }

    def get_cartridge_info(self):
        channel = 0
        data = b'\x00' * 100
        self._fill_cartridge_info(channel, data)
        return self.cartridgeinfo[channel]
config = {}
extruder_num = 0
cartridge_reader = CartridgeReader()
printer_extruder = PrinterExtruder(config, extruder_num, cartridge_reader)

Does this change anything for Fluid, or is it the wrong way? I just can’t load it from the config file; it’s extracted from the cartridge. Thank you !

Fluidd is designed on top of mainline Klipper (and Kalico fork) only, so any changes made to Klipper base files are unsupported.

In this case, Fluidd will just ignore the changes you are making here as it has no knowledge of your custom nozzle_diameter.

1 Like

Thank you for your help!