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

Limit extruder feedrate for printing and retraction #5248

Open
MarkMan0 opened this issue Jan 30, 2019 · 77 comments
Open

Limit extruder feedrate for printing and retraction #5248

MarkMan0 opened this issue Jan 30, 2019 · 77 comments
Labels
Status: On Backlog The issue / feature has been reproduced and is deemed important enough to be fixed. Type: New Feature Adding some entirely new functionality.

Comments

@MarkMan0
Copy link
Contributor

MarkMan0 commented Jan 30, 2019

Application Version
3.6.0

Platform
Windows 10

Printer
With Marlin firmware

So I'd like to have a feature to limit the maximum speed of the extruder, while printing.
I've tried doing this by chaging the limits in firmware, but it made retraction slow too, obviously.

So what I imagine is a new setting in the speed tab, like retraction speed
Extruder max. speed [mm/s] - lets say 3mm/s. Thats 180 mm/min

And then in the gcode it would be like:
.....
M203 E180 ; set extruder speed for printing
; printing now
G1
G1
G1
...
;Now retract, reset feedrate
M203 E...
G1 ;retract
G0 ;travel
G0
G1 ; un-retract
M203 E180 ; reset feedrate

Why I think this is good?
We can easily measure the max. feedrate our printer can handle with certain filaments. For me it's 200mm/min. This value doesn't change for different layer heights, so no need to play with temperature/speed settings when increasing layer height.

The max print speed would be limited in firmware.

Edit:
I'm a hobby programmer. The way I would go implementing this, is:
stick an M203 at the beginning

before every retraction set M203
after every retraction, set M203

@Ghostkeeper
Copy link
Collaborator

This has been asked of us before but I can't find the original back right now.

We would prefer to implement this in a somewhat different way: Using inheritance formulas in the front-end. You would set the maximum flow rate as a setting in mm³/s, and the setting for the print speed would be a formula such as this:

speed_print = =max_flow / layer_height / line_width

And then the printing speed would be adjusted down if you increase the layer height.

What I'm not really sure about yet though is how that would look if there are also other constraints to the print speed, such as accelerations in the outer wall causing ringing, steppers losing steps when going too fast, etc.

@MarkMan0
Copy link
Contributor Author

MarkMan0 commented Feb 2, 2019

Sounds great! Looking forward to it :)

At first sight it doesn't look like it's going to cause ringing, you're essentially just adjusting the max print speed.
The final formula for the speed could be something like:
speed_print = min( (max_flow / layer_height / line_width), user_set_max_speed)

I would only use it to insure, that I'm not printing faster than my extruder can handle.
I got the idea when printing 0.32 infill and 0.16 wall, at 100mm/s. The walls were fine, but the infill was under-extruded.

For now I'll write myself a parser

@MrStump
Copy link

MrStump commented Sep 9, 2019

This has been asked of us before but I can't find the original back right now.

We would prefer to implement this in a somewhat different way: Using inheritance formulas in the front-end. You would set the maximum flow rate as a setting in mm³/s, and the setting for the print speed would be a formula such as this:

speed_print = =max_flow / layer_height / line_width

And then the printing speed would be adjusted down if you increase the layer height.

What I'm not really sure about yet though is how that would look if there are also other constraints to the print speed, such as accelerations in the outer wall causing ringing, steppers losing steps when going too fast, etc.

Hi, any news on this? this really helpfull feature

@Ghostkeeper
Copy link
Collaborator

Not really, but it depends on the printer you're using. Realistically it's hard to get this sort of thing through for Ultimaker printers, since all of Ultimaker's profiles need to be re-tested then. For other printers we're dependent on people from the community that have those printers to test, but since they don't have a setting to test with it's not going to be easy for them. A bit of a circle of dependencies going on.

@MrStump
Copy link

MrStump commented Sep 9, 2019

Not really, but it depends on the printer you're using. Realistically it's hard to get this sort of thing through for Ultimaker printers, since all of Ultimaker's profiles need to be re-tested then. For other printers we're dependent on people from the community that have those printers to test, but since they don't have a setting to test with it's not going to be easy for them. A bit of a circle of dependencies going on.

may be just add setting for "extrusion speed" in the speed tab, or material tab? and user can calibrate it themself. it's like calibrate step/mm for extruder but trough hot nozzle, command "feed" 100mm and measure is it really go 100mm through extruder with hot nozzle or just 85mm.
for ex. my extruder can melt plastic with 3.5mm/sec direct flow. with 0.8 nozzle and 0.4layer it can provide max feedrate is ~70-80mm/sec, with 0.3 layer it can 80-100mm/sec. for this moment i test it with every nozzle/layer change, but if we'll have setting like this then slicer will limit max print speed depends on "raw extrusion speed", not "feeder speed". for now it could be added in "experimental tab". really, it would be reeeealy helpful.

@Ghostkeeper
Copy link
Collaborator

If the "extrusion speed" changes, would it change the line width or the printing speed?

@MrStump
Copy link

MrStump commented Sep 10, 2019

It should limit printing speed. Because if I want smaller line width i can set it. But if extruder can't provide needful amount of plastic on current printing speed with current line width and layer height then printer should slowdown.
For this moment with plugin "printer settings" i can set "maximum feedrate" but it limit whole extruder speed and i can't use retract.

@Ghostkeeper
Copy link
Collaborator

Ghostkeeper commented Sep 10, 2019

Hmm, I think the most major concern left then is that the printing speed settings won't work any more then. Either that, or the extrusion speed setting won't work if the printing speed settings are overridden by any profile.

@MrStump
Copy link

MrStump commented Sep 10, 2019

in my opinion "extrusion speed" should be in charge, by default it could be as lightspeed, but if user want to calibrate "melt plastic extrusion speed" then feedrate should be limited by it. For example i don't really know is my priter able melt "this plastic" through 0.8 nozzle with layer 0.4 at speed 100mm/sec. but if there will be an option "melt plastic extrusion speed" that i checked before (like 3mm/sec) then slicer limit feedrate speed to 92mm/sec, because slicer can calculate what really speed of "melt plastic extrusion speed" will be in that setup and i'm not :)
i mean if through 0.8 nozzle with layer 0.4 at speed 100mm/sec my extruder should feed raw plastic with 3.5mm/sec - my extruder would'n able to do it right, gear start to slip on raw plastic, there is clogging in nozzle and print will not be successfull. in case when we have THAT option CURA will show me that speed of infill with 100mm/sec is "yellow warning" or just limit it when sliced.
sorry for my not realy good english.
Regards,
Stump )

@Ghostkeeper
Copy link
Collaborator

You mean that there should be a "maximum extruder feed rate" setting, then, but one that does not limit the retraction speeds as well.

@MrStump
Copy link

MrStump commented Sep 11, 2019

yes. actually i don't know when CURA calculate actual speed of extruder feedrate, i think CURA do it only when it slicing.
so it should limit whole printing speed limited with "maximum extruder feed rate" while it calculate all. by default it could be at "light speed"
it's like "Minimum Layer Time", but vice versa

@perfessor101
Copy link

I would really like this feature too, a setting for the Maximum Volumetric Flow rate of the Extruder HotEnd combination.
Quite often I'll set my speeds thinking I have things dialed in for that print and then ninety minutes into the print the extruder will start clicking causing under extrusion as it snaps back and possibly other imperfections as it snaps forward again.
At that point I have to decide if I would rather have the extra imperfections or try again throwing out what has been printed so far.

CNC Kitchen has a video showing how at higher volumetric flows the amount extruded drops off and can be somewhat compensated for with temperature increases. This could help with keeping those volumetric flowrate inconsistencies in check .

@dariuskt
Copy link

That is a very needed feature for me too. With 0.8 and 1.0mm nozzles extruder becomes the only limit for print speed.

Looks like this feed limit should naturally behave like Minimum Layer Time. It is a dynamic limitation as Layer Height and Line Width may be variable through the print.

Units for this configuration aren't that important as mm³/s and mm/s are basically the same and cant change independently for a given filament width.

@sbstnzmr
Copy link

sbstnzmr commented Jun 6, 2020

Hey. I would really love to see that feature too. Not only for the larger nozzle diameters but also for filaments like TPU this is really useful.

As far as my experiences with other slicers go I would assume an implementation liket this: For PLA afaik 12-15 mm³/s is a good starting point for a regular hotend. This should limit the maximum printing speed. Or not if you assume a 0.4 nozzle because your printer can probably not go that fast so your regular printing speed applies. It's basically a max function on your volumetric speed and your print speed settings. For a 0.8 nozzle and a 0.4 layer height it would automatically calculate the maximum speed and still respect your regular speed settings otherwise. For a volcano it's more in the 30 mm³/s department so I personally don't really need it however it does make a difference for common hotends.

For TPU/Flex this makes adjusting settings also much easier. You could just set your max volumetric speed to something like 1.5 mm³/s and assuming a .2 layer height and a .44 line width your print speed would cap at 1.5/(0.2*0.44). Like this I can basically print speed constrained materials without messing with print speed settings.

I know what to set manually but especially more inexperienced users who would try larger nozzles on a common hotend would benefit from not messing up the prints and clogging the hotend. And I just miss this setting since it seems like a calculation that could be possible.

@perfessor101
Copy link

For an ender 3 with a 0.4mm nozzle it’s closer to 6 or 7 cubic mm/s ... 50 mm/s with 0.5mm nozzle 0.635 mm line width and 0.24 mm layer height clicking away ... dropped down to 45%. So much easier to limit it by volumetric rate. Then if I make a mistake (Going too fast) I don’t have to slow everything down.

@AndrewEllis93
Copy link

+1. This is the primary thing that stops me from using Cura as much as I'd like.

@MrStump
Copy link

MrStump commented Jun 29, 2020

any news about Volumetric speed limits?

@Ghostkeeper
Copy link
Collaborator

Sorry, no, we haven't worked on this yet.

@Aggebitter
Copy link

Some addon to the tread. The Volumetric speed aka mm3/s is critical on all FDM printers! If you hit that limit under extrusion is a fact.

I had an issue with my bowden tube and made some tests and calculations (good page for the math and how to test http://projects.ttlexceeded.com/3dprinting_calibrating_volumetric_rate.html)

My results with a stock Volcano head 0.8mm nozzle on stock Flsun Q5 gave me this:

Filament: PrimaValue Black PLA

(bad bowden tube)
Temp Max Extrusion speed mm3/s (F/60 * A (2.403 for 1.75) )
M109 S200 G1 E100 F200 8.01 mm3/s
M109 S210 G1 E100 F350 12.015 mm3/s
M109 S220 G1 E100 F500 20.025 mm3/s

(changed to unbranded one laying around)
M109 S190 G1 E100 F550 22.0275 mm3/s
M109 S200 G1 E100 F600 24.03 mm3/s
M109 S210 G1 E100 F650 26.0325 mm3/s
M109 S220 G1 E100 F750 30.025 mm3/s

30mm/s is the max my setup can extrude in open air. That limit should never be passed. Adding a safety margin for back pressure when extruding will have to be applied but in my case that was needed when I printed at 0.10mm layer with a 0.8mm nozzle (yes it did print just fine at 1mm line width)

To control extrusion with mm/s instead of mm2/s gives you a lot of errors you have to tweek.
-The gripping diameter of the filament pulley is depending on how soft the filament is. The gripping radius will change and thereby the distance per step will change.
-The nozzle pressure depends a lot on nozzle temperature for each filament used
-The layer height generates different back pressure especially when using "ironing" with a wider line width than nozzle diameter

By using mm2/s we will reduce the needed tweaking to just for each filament to for constants:

Temperature: C
Layer height: mm
Line width: mm
Volumetric: mm3/s

And we will get max printing speed in mm/s by doing the math
20mm3/s @ 0.2mm layer and 1mm line width gives:
20mm3 / (0.2mm * 1mm) = 100mm/s max speed

After that calculation we can start doing all the nice printout tweaks
//Agge

@Glodigit
Copy link

+1 on this

@sgessner
Copy link

sgessner commented Jan 9, 2021

+1 ; Would be nice to have that feature!

@controlflow
Copy link

+1, I really miss this option

@Malmik
Copy link

Malmik commented Jan 20, 2021

+1

@Jackjan4
Copy link

+1 however I would implement it as maximum volumetric flow rate since PrusaSlicer has it and its fantastic for working out what the extruder is capable to do with different filaments.

@rcmonitor
Copy link

+1 for mm/time unit setting (mm/s or mm/min).
Volume of material may vary (the filament spool may be of let's say 2.90 instead of 2.85, or 1.70 instead of 1.75), but the performance of extruder on filament may not.

@conceptual-perception
Copy link

conceptual-perception commented Mar 26, 2021

I have a Prusa i3 M3KS and ... changing out the nozzle from 0.4 to 0.8 ... broke Cura completely. I started a print and ... my Octoprint setup threw a M112 message. It took me a bit to understand what had happened, that Cura instructed the printer to send filament faster then the printer could safely extrude it. Thankfully, my printed detected this as a thermal runaway event and forced a reset.

I don't really see from a user perspective how this is possible, since the MVS value is the known limit. My E3D v6 hotend can only handle 15mm^3 a second. Where do I put this value into Cura? I thought adjusting the nozzle size would ... change other settings (it didn't), but ... idk if it's worth me going in and figuring out all the speeds for all the parts of the print. That seems like work software should do.

https://help.prusa3d.com/en/article/max-volumetric-speed_127176

The Maximum volumetric speed setting (MVS) is one of the most powerful features in PrusaSlicer. The MVS setting essentially creates a manager for the maximum amount of filament that the slicer will attempt to push through your 3D printer’s hotend.

This gives PrusaSlicer users a huge advantage. Rather than trying to calculate a range of speeds for combinations of different nozzle sizes, layer heights or extrusion widths, you can simply specify the speeds and settings you desire, then let MVS regulate speeds at slice time when and only if necessary.

I love Cura, but this missing, hurts.

@Pennerbert
Copy link

+1
Any news out there?

@Arsoth
Copy link

Arsoth commented Nov 27, 2022

Easy to do so I have added a Max Filament Flow Rate setting to my Cura variant and it will be available in the next release (4.20.9) (see https://github.com/smartavionics/Cura/releases).

Any chance you could put a PR in for that... or is it wildly incompatible with Arachne (I'm sure I misspelled that) engine?

@psiberfunk
Copy link

psiberfunk commented Nov 27, 2022

Any chance you could put a PR in for that... or is it wildly incompatible with Arachne (I'm sure I misspelled that) engine?

Sorry, I no longer submit PR's for anything other than fixes for my own bugs. The good news is that the required changes are trivial so anyone who can build Cura 5 from source could submit an equivalent PR with little effort.

I’m not sure why you would comment on this thread if you’re to dangle a fix, plug your own fork , but not going to submit a “trivial” PR upstream. That’s a little rude IMO. Such behavior is only normal when the upstream project is abandoned or not accepting PRs.

@tastyratz
Copy link
Contributor

I mean, I get that you have your own fork which gives you a lot more freedom and I suspect there could be politics being in the big sandbox with everyone else, but, I really hope you reconsider this position. Having your own fork is great when you want to take things a new direction and have a different vision. Having your own fork is simpler. It's also great to put your changes in there if they are denied by the main branch because of fundamental differences on the end result.

If you won't even submit a PR to begin with though, Those things don't really apply.

I'm glad you made the change and that you feel it's rather trivial to implement Please consider helping everyone at large who isn't using a spinoff.

@psiberfunk
Copy link

I'm glad you made the change and that you feel it's rather trivial to implement Please consider helping everyone at large who isn't using a spinoff.

Or that doesn't have the deep familiarity with Cura or the build system...

@Arsoth
Copy link

Arsoth commented Nov 27, 2022

Oh well, he deleted his comments. Guess he took his toys and went home, but at least now we know it's possible and "trivial"; hopefully someone from the Cura team or who has a good understanding of the code can implement that so the rest of us can use this feature!

@psiberfunk
Copy link

psiberfunk commented Nov 27, 2022

So, I was just browsing his relevant changes, which I found buried in his branch here (he did not link to them easily for some reason): smartavionics@81a6fdd?diff=unified

While I don't understand the Cura codebase at all.. it seems like based on the changes this is a slicer front-end setting in config files to somehow trigger the use of a CuraEngine feature that's buried... but I can't find any reference to it in the mainline CuraEngine code.. so i'm going to go hunting in his CuraEngine Fork for them..

@psiberfunk
Copy link

If someone wanted to pull this in, it would seem you'd need to pull in his additions to the CuraEngine project as well, which I located here:
image
https://github.com/smartavionics/CuraEngine/commits/mb-testing

@olmedocr
Copy link

@psiberfunk are those two changes (engine + cura) the only ones needed? Why don't you try and submit the PR?

@maruhe
Copy link

maruhe commented Jan 26, 2023

I use adaptive layer high and on 0,3mm layer and 120mm/s I'm at the end of my revo
so to print support and infill a little slower for this layers would help and
limiting extruder feedrate / volumetric flow would solve this :-)
as I already see the flow in cura preview i hope there well be a way
grafik

@mjc-506
Copy link

mjc-506 commented Feb 1, 2023

Submitted a couple of PRs for this (one for Cura #14452 , one for CuraEngine Ultimaker/CuraEngine#1814 ) that implement this, copying the code used for 4.20 above smartavionics@81a6fdd?diff=unified

This works-on-my-machine(tm) (ie, keeps flow rate at or below the limit set) but it does seem simple enough so can't foresee any problems...

@ghost
Copy link

ghost commented Feb 9, 2023

@mjc-506
It did not compile with freshly fetched repositories. There might have been some changes in CuraEngine since you've last updated your fork.

Anyways, I've created a PR on your repo with all necessary changes that made compilation possible on-my-machine⟨™⟩.

@matthewj301
Copy link

Thanks @mjc-506 and @mashuptwice for your work on this! I feel like this is one of the main features missing compared.to PS and SS (besides common-sense filament management 😛)

@tastyratz
Copy link
Contributor

Did you want to linkback your pull here so we could follow the progress on this one? It might make it easier to keep track of. I just checked back in on the thread and thought it could be helpful.

@tastyratz
Copy link
Contributor

This one sat for awhile and I just noticed that Ultimaker/CuraEngine#1828 pull request was closed. It looks like Mashuptwice deleted their github account and the pull died with it.

Does that mean we're back to square one on this very important request?

@mjc-506
Copy link

mjc-506 commented May 12, 2023

Whhaaaaat?! :(
[s]#1814[/s] should be good to go I think, but has a conflict that needs someone to resolve. (line 2057 removing?)
#14452 (for Cura) looks ok too?

@Arsoth
Copy link

Arsoth commented May 12, 2023

(1814 meaning this PR for those confused: Ultimaker/CuraEngine#1814 )

@mjc-506
Copy link

mjc-506 commented May 12, 2023

D'oh, sorry, getting confused where I am... :-)

@cubitik
Copy link

cubitik commented Mar 14, 2024

+1, Cura getting boring.

@ArnoldDeRuiter
Copy link

Would also like to be able to set flow rate in Cura. Great improvements have been made already! This one is noticeably missing still however.

@konddda
Copy link

konddda commented Mar 23, 2024

+1. I can't beliele, there is no max volumetric flow rate

@olszewski
Copy link

Please for the love of everything good add this to the slicer. It would be an immensely powerful feature that with a current model I am looking at would be able to cut my print time down to 1/3 if I was able to maximize the flow rate across it.

The printer speed or flow rate isn't the limiting factor at all right, it's just the lack of this feature in the slicer to automate things.

I appreciate your work guys!

@tastyratz
Copy link
Contributor

I cannot believe that Cura is STILL the only slicer left that does not have this very basic setting like all modern slicers. The fact that I'm still getting notifications from this post this many years later is WILD.

This is a 5 year old req! And it's a bare minimum requirement necessary on any modern high-speed printer since that timeframe.
I'm glad I didn't wait around for it.
If Ultimaker wants to retain any userbase that has mixed mode environments with any coreXY printers in house, this is a showstopper.

@GregValiant
Copy link
Collaborator

GregValiant commented Nov 24, 2024

Looking at this it would appear that the ability to make these adjustments has been present for a long time. Search and Replace could be used as @MarkMan0 first indicated. Regular Expressions (admittedly a PITA) make it possible.

(These will work whether you use Relative Extrusion or Absolute Extrusion)
Without firmware retraction:
Search for: G1 F(\d*\d.?) E(-?\d.*)
Replace: M203 E50\nG1 F\1 E\2\nM203 E5
Regular Expressions: Checked

That would result in something like this:
M203 E50
G1 F2400 E672.2831
M203 E5
G0 F3600 X248.112 Y134.88
M203 E50
G1 F2400 E672.8831
M203 E5

With Firmware Retraction enabled it's slightly different:
Search for: G1[0-1]
Replace: M203 E50\nG1\1\nM203 E5
Regular Expressions: Checked

That would result in this:
M203 E50
G10
M203 E5
G0 F3600 X248.112 Y134.88
M203 E50
G11
M203 E5

I have scribbled up this post processor which does the same thing. It does allow the user to input the Max Volumetric Flow and then does the simple math in the background.
Consider this a beta version. Unzip the file and place "MaxVolumetricSpeed.py" into the "scripts" sub-folder in your "Configuration Folder". It will be available with the other post processors under "Extensions" in Cura.
I'll submit a pull request (#19951) and see if they will add it to Cura. Some feedback here would be good.
MaxVolumetricSpeed.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: On Backlog The issue / feature has been reproduced and is deemed important enough to be fixed. Type: New Feature Adding some entirely new functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.