Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] SET_NOZZLE_SIZE #797

Closed
Hywelmartin opened this issue Oct 19, 2018 · 17 comments
Closed

[FR] SET_NOZZLE_SIZE #797

Hywelmartin opened this issue Oct 19, 2018 · 17 comments

Comments

@Hywelmartin
Copy link
Contributor

I haven't found any way(other than edit printer.cfg) to alter nozzle size

So my suggestion is to have a extended gcode like:
SET_NOZZLE_SIZE 0.4
that could be a part of start gcode or just punched in in the octopi terminal

And by the way GREAT FW...

/Martin

@FHeilmann
Copy link
Contributor

Nozzle size is not something the printer is aware of. This is entirely handled by the slicer. Which functionality do you expect to achieve with this command?

@Hywelmartin
Copy link
Contributor Author

so why is there a setting for that in the [extruder] part in all examples of the printer.cfg??

nozzle_diameter: 0.400

It's in the config and when I switch the nozzle aren't I supposed to change the value...?? otherwise the [FR] is "remove nozzle_diameter: setting from config"

It must be doing something....?? because you cannot run without it "No option 'nozzle_diameter' in section: 'extruder'"

@FHeilmann
Copy link
Contributor

FHeilmann commented Oct 19, 2018

Apologies, I forgot about that because I never bothered to change that parameter.

It's used for a security feature where the firmware rejects moves that extrude more material than the hotend can handle. Unless you are running into issues where your printer rejects gcode due to too much filament extruded you can leave this value at 0.4 and simply ignore it. Aside from that it's not unreasonable to assume that if someone makes a hardware modification to their printer via a nozzle swap it should also be their responsibility to adjust their printer configuration accordingly.

@Hywelmartin
Copy link
Contributor Author

confusing..
The volumetric flow is not dependent on the nozzle size....

To be able to know the volumetric flow you need the steps/mm from the extruder and the filament diameter... not the nozzle size... what you put in shall get out... if the fw depend on the nozzle size to determent the volumetric flow there is at least one calculation to many...

I switch nozzles rather frequently so I taught that it would be beneficial to be able to adjusting the parameters in another way... So I can put at a arbitrary value and forget it.... good to know..

/Martin

@FHeilmann
Copy link
Contributor

FHeilmann commented Oct 19, 2018

My reply was unclear, its not volumetric flow but extrude ratio.

        self.nozzle_diameter = config.getfloat('nozzle_diameter', above=0.)
        filament_diameter = config.getfloat(
            'filament_diameter', minval=self.nozzle_diameter)
        self.filament_area = math.pi * (filament_diameter * .5)**2
        max_cross_section = config.getfloat(
            'max_extrude_cross_section', 4. * self.nozzle_diameter**2
            , above=0.)
        self.max_extrude_ratio = max_cross_section / self.filament_area

This is where the nozzle diameter gets used.

move.extrude_r = move.axes_d[3] / move.move_d
[...]
        elif move.extrude_r > self.max_extrude_ratio:
            if move.axes_d[3] <= self.nozzle_diameter * self.max_extrude_ratio:
                # Permit extrusion if amount extruded is tiny
                move.extrude_r = self.max_extrude_ratio
                return
            area = move.axes_d[3] * self.filament_area / move.move_d
            logging.debug("Overextrude: %s vs %s (area=%.3f dist=%.3f)",
                          move.extrude_r, self.max_extrude_ratio,
                          area, move.move_d)

this is where the result of that calculation is checked.

@Hywelmartin
Copy link
Contributor Author

well I'm not a coder so ... i don't get anything out of this... well something

but my point stands if it's a useful parameter that we would be able to adjust it by extended gcode..

feel free to evaluate and take the next step..

@jakep82
Copy link

jakep82 commented Oct 19, 2018

As @FHeilmann noted this is only a safety feature. If you're going to change nozzles, it's not unreasonable to also update your config, so this doesn't need to be run-time configurable. I just leave mine at 0.5 which is the largest nozzle I ever use, and don't bother changing it.

@faboaic
Copy link

faboaic commented Oct 24, 2018

I often print with 0.4mm nozzle diameter but extrusion width 0.8 - 1.2 mm.
So this safety feature just ruined a print of mine.

Now I set nozzle diameter in printer.cfg to 0.8mm and see what happens...

@FHeilmann
Copy link
Contributor

FHeilmann commented Oct 24, 2018

your use case is what the max_extrude_cross_section configuration parameter is for. By default it is 4*nozzle diameter^2 which allows the equivalent of .8 extrusion width for a .4mm nozzle.

In your case (with a 1.2mm extrusion width) you can set this to 4 * 0.6^2 (=1.44) to raise the safe limit and allow you to extrude up to 1.2mm extrusion width with a 0.4mm nozzle.

Klipper didn't ruin your print, your configuration did not account for your specific use-case.

@faboaic
Copy link

faboaic commented Oct 24, 2018

I will try that setting.

Klipper itself did not ruin the print but the default configuration is too conservative regarding extrusion width.
A factor of 2.5 or 3 is no problem for most scenarios.
I know... Many users think that with 0.4mm nozzle you can only print 0.4 - 0.48mm extrusion width. ;)

What really would help :
Run a sanity check or simulation of the whole gcode before the print instead of cancelling it after some hours...

Thanks, Fabian

@KevinOConnor
Copy link
Collaborator

Just to be clear, the max_extrude_cross_section specifies an area - it is the extrusion height multiplied by the extrusion width. With a layer height of .3 and a nozzle diameter of .4, the default value would permit an extrusion width of 2.133mm. The default value is significantly larger than any sane printing value.

-Kevin

@Hywelmartin
Copy link
Contributor Author

thank for your time...

@Hywelmartin
Copy link
Contributor Author

@KevinOConnor
Just for clarification...

The nozzle_size or any derivatives of set size (like "max_extrude_ratio"), does it have any other function than to give an error.
Does it have anything to do with PA??
I'm asking due to the fact that it has been claimed that there is an impact on PA...

@ardyesp
Copy link

ardyesp commented Feb 10, 2021

Here is another vote for this feature.

Changing the Klipper configuration, every time nozzle is changed does not work well in a workflow. It is much streamlined to have a SET_NOZZLE_SIZE gcode.
In the absence of this gcode, we are forced to configure an arbitrarily large value for max_extrude_ratio and loose the over-extrude protection offered by it.

BTW: Excellent firmware, I love it!

@tarsonis123
Copy link

So this looks like this feature won't see any light, what is the max value I have to put in max_extrude_cross_section to use a 1.0 nozzle with default ext. width and don't need to set this value ever again swapping to smaller sizes afterwards? I'm dumb af and have no clue about the math cheers

@ardyesp
Copy link

ardyesp commented Mar 1, 2021

Another failed print - I think I will hardcode this for 1mm nozzle too. According to docs, this limit is 4.0 * nozzle_diameter^2, which comes out to 4 for a 1mm nozzle.

[extruder]
.
.
max_extrude_cross_section: 4

@clinta
Copy link

clinta commented Mar 28, 2021

It's a shame this is closed. This would be really helpful because I could configure prusa slicer to use the nozzle_diameter variable to correctly set the nozzle diameter in klipper to match what the slicer is configured for at the start of every print.

I've started doing this for pressure advance, using SET_PRESSURE_ADVANCE ADVANCE as custom gcode in the filament settings to have correct pressure advance for each filament. I'd like to have all the settings that I might be changing on a regular basis be able to be set by the slicer.

clinta added a commit to clinta/klipper that referenced this issue Mar 29, 2021
As discussed in Klipper3d#797, being able to set the nozzle_diameter via gcode is
useful. Because of how inter-related nozzle_diameter,
filament_diameter, max_cross_section, max_e_velocity and max_e_accel
are, this change adds a SET_EXTRUDER command that can set any of these
parameters.

The last configured value for max_cross_section, max_e_velocity and
max_e_accel are persisted so that invocations of the gcode can know if
these parameters were explicitly configured, or automatically
calculated. If they were explicitly configured, and not specified in
the g-code invocation, they will not be changed. If they were not
configured, or are set to 0 by g-code, they will be automatically
calculated.

Signed-off-by: Clint Armstrong <clint@clintarmstrong.net>
clinta added a commit to clinta/klipper that referenced this issue Mar 29, 2021
As discussed in Klipper3d#797, being able to set the nozzle_diameter via gcode is
useful. Because of how inter-related nozzle_diameter,
filament_diameter, max_cross_section, max_e_velocity and max_e_accel
are, this change adds a SET_EXTRUDER command that can set any of these
parameters.

The last configured value for max_cross_section, max_e_velocity and
max_e_accel are persisted so that invocations of the gcode can know if
these parameters were explicitly configured, or automatically
calculated. If they were explicitly configured, and not specified in
the g-code invocation, they will not be changed. If they were not
configured, or are set to 0 by g-code, they will be automatically
calculated.

Signed-off-by: Clint Armstrong <clint@clintarmstrong.net>
clinta added a commit to clinta/klipper that referenced this issue Mar 29, 2021
As discussed in Klipper3d#797, being able to set the nozzle_diameter via gcode is
useful. Because of how inter-related nozzle_diameter,
filament_diameter, max_cross_section, max_e_velocity and max_e_accel
are, this change adds a SET_EXTRUDER command that can set any of these
parameters.

The last configured value for max_cross_section, max_e_velocity and
max_e_accel are persisted so that invocations of the gcode can know if
these parameters were explicitly configured, or automatically
calculated. If they were explicitly configured, and not specified in
the g-code invocation, they will not be changed. If they were not
configured, or are set to 0 by g-code, they will be automatically
calculated.

Signed-off-by: Clint Armstrong <clint@clintarmstrong.net>
clinta added a commit to clinta/klipper that referenced this issue Mar 29, 2021
As discussed in Klipper3d#797, being able to set the nozzle_diameter via gcode is
useful. Because of how inter-related nozzle_diameter,
filament_diameter, max_cross_section, max_e_velocity and max_e_accel
are, this change adds a SET_EXTRUDER command that can set any of these
parameters.

The last configured value for max_cross_section, max_e_velocity and
max_e_accel are persisted so that invocations of the gcode can know if
these parameters were explicitly configured, or automatically
calculated. If they were explicitly configured, and not specified in
the g-code invocation, they will not be changed. If they were not
configured, or are set to 0 by g-code, they will be automatically
calculated.

Signed-off-by: Clint Armstrong <clint@clintarmstrong.net>
clinta added a commit to clinta/klipper that referenced this issue Mar 29, 2021
As discussed in Klipper3d#797, being able to set the nozzle_diameter via gcode is
useful. Because of how inter-related nozzle_diameter,
filament_diameter, max_cross_section, max_e_velocity and max_e_accel
are, this change adds a SET_EXTRUDER command that can set any of these
parameters.

The last configured value for max_cross_section, max_e_velocity and
max_e_accel are persisted so that invocations of the gcode can know if
these parameters were explicitly configured, or automatically
calculated. If they were explicitly configured, and not specified in
the g-code invocation, they will not be changed. If they were not
configured, or are set to 0 by g-code, they will be automatically
calculated.

Signed-off-by: Clint Armstrong <clint@clintarmstrong.net>
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants