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] M592 From RepRapFirmware (nonlinear extrusion) #9852

Closed
ArtemKuchin opened this issue Feb 28, 2018 · 45 comments
Closed

[FR] M592 From RepRapFirmware (nonlinear extrusion) #9852

ArtemKuchin opened this issue Feb 28, 2018 · 45 comments
Labels
T: Feature Request Features requested by users.

Comments

@ArtemKuchin
Copy link

ArtemKuchin commented Feb 28, 2018

Just discovered the problem with extrusion error vs extrusion speed on my own experience.
See discussion
http://forums.reprap.org/read.php?262,802277
Don't have any option other than to print at low speeds at least for external perimeters to get better quality.
RepRap firmware guys did M592 for nonlinear extrusion compensation.

Hope such thing will be implemented in Marlin.


http://reprap.org/wiki/G-code

Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.

Nonlinear extrusion is an experimental feature in RepRapFirmware to compensate for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, Av + Bv^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.

Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.

@thinkyhead
Copy link
Member

thinkyhead commented Feb 28, 2018

Marlin's LIN_ADVANCE feature (recently updated to v1.5) is recommended to deal with back-pressure and regulation of line-widths. http://marlinfw.org/docs/features/lin_advance.html

@thinkyhead thinkyhead added the T: Feature Request Features requested by users. label Feb 28, 2018
@ArtemKuchin
Copy link
Author

Yes i know, but does it really compensate for speed extrusion error when extruder just does not extruder the needed amount of filament?
I though LIN_ADVANCE is more like coasting and assumes that extruder physically extruder the given amount of filament. But it does not, see graph in the first message in the forum link i gave.

@ArtemKuchin
Copy link
Author

For clarification: Here is my test
http://forums.reprap.org/read.php?1,812325,812339#msg-812339
It is just a constant extrusion, not speed ups or speed downs. So, as i understand LIN ADVANCE will not help here at all.

@Sebastianv650
Copy link
Contributor

@ArtemKuchin for me it's not clear what you try to compensate. Is it for slipping hobbed bolt? You table in the link is also confusing for me, at 360mm/min you got 1.13g, at 60mm/min you got only 0.69g? Doesn't make much sense to me, if something is slipping it should be the opposite way round.

If it's slipping, that's something that has to be solved by hardware in my opinion. I never had a problem with slipping drive gears, at every volumetric speed I ever tried the limit was Marlin calculation speed in most cases and only if I realy push it to extreme I'm hitting the melt capabilities of my hotend. In both cases, adjusting esteps/mm will not help.

@AnHardt
Copy link
Member

AnHardt commented Feb 28, 2018

In short.
Some observe under extrusion at high extrusion speeds. The try to calibrate steps/mm for different speeds and get different results even if there are no, visible signs for a grinding bobbed bolt, or audible lost steps. What is causing the effect is not entirely clear and how to properly test even more.
An attempt to compensate for that was made by dc42. He calculates (somehow) steps/mm from e-speed and some constants (http://reprap.org/wiki/G-code#M592:_Configure_nonlinear_extrusion).

Linear advance is another pair of shoes. It deals with a delayed reaction of outflow when extrusion speed changes - not the absolute amount.

@thinkyhead thinkyhead changed the title [FR] M592 From RepRapefirmware nonlinear extrusion [FR] M592 From RepRapFirmware (nonlinear extrusion) Feb 28, 2018
@thinkyhead
Copy link
Member

thinkyhead commented Feb 28, 2018

Presumably the issue has to do with the expansion of the filament, where at high speeds it might not expand as much. It sounds like something that would be sort-of akin to a long Bowden tube adding more flexibility to the drive.

@AnHardt
Copy link
Member

AnHardt commented Feb 28, 2018

The different steps/mm seem to be measurable at the input side of the extruder.

@thinkyhead
Copy link
Member

thinkyhead commented Mar 1, 2018

From what I've read online it is attributed to what amounts to "slipping" (or "missing") the teeth on an extruder that has a typical MK8-style drive wheel. I'm sure it doesn't affect a Bondtech Extruder, where there is constant grip. But if there are gaps between the points where grip can occur, I can see how the filament might "spring back" between those points, especially as pressure builds up.

@ArtemKuchin
Copy link
Author

ArtemKuchin commented Mar 1, 2018

@Sebastianv650 The described effect is observable on both direct drive, geared and belted extruders with hobbed bolts and with toothed wheels, direct or Bowden. No matter how tight the extruder is. All people who actually did the test see then actual extruded length depends on extrusion speed. The physics behind this is not 100% clear. You can read the forum post i provided and links from there. People did the graphs to see the correlation.

About 1.13g - plase, look carefully. 1.13 is mm - it is diameter, weight is 0.54-0.55g
0.69 is mm too, weight is 0.58g. You mixed the columns.

@AnHardt Not some, but everyone i know who did the tests. Maybe others just don't have the tools, time or will. or don't care.
From what i read myself (did not test it personally) the effect is not present when nozzle is removed. And error is measurable on input side as filament length OR on the output side as filament (model) weight.

@thinkyhead I did not read about Bondtech, pretty rare beast and don;t know how it works, but the problem is very much present on E3D titan and on belted extruders. Also, if that was slipping then tightening the extruder should at least do some change, but no, in my test tightening the extruded results exactly in the same numbers. So, there was no slipping. I have direct extrusion extruder (not Bowden) and see the effect very much. BTW: Where did you read that online?

Also, note than the problem is present for at least PLA and ABS filament types. I tested only PLA. Have SBS (softer, more like stiff rubber, 220C printe T) also, will test and see if the graph form is the same.

@thinkyhead
Copy link
Member

thinkyhead commented Mar 1, 2018

Could it be that the material extruded at higher speeds is simply denser and less spongy at the microscopic level? And if so, how does this effect manifest in different materials?

Perhaps we can do tests and actually weigh the filament that is extruded down to the milligram. If the weight-per-length is different that would fit the hypothesis.

@ArtemKuchin
Copy link
Author

@thinkyhead i will test PLA vs SBS today on non-print extrusion and weight to 10s of milligram. My scales have 0.01 accuracy and resolution.
For PLA i did test for weight here http://forums.reprap.org/read.php?1,812325,812339#msg-812339
already
So, i'll do SBS.

@ArtemKuchin
Copy link
Author

ArtemKuchin commented Mar 1, 2018

Okay, did synthetic tests with SBS and real prints.

L - extrusion length, also, how many times and pause time
T - temperature
F - feed rate
D - extruded diameter
W - weight of extruded filament

L can be just number (400) - which is mm
Or like this 4x100x2 - means 4 times 100mm with 2 second pause

L       | T   | F   | D    | W    | NOTE
    400 | 220 | 60  | 0,66 | 0,93 |  
    400 | 220 | 360 | 1,07 | 0,93 |  
    400 | 220 | 480 | 1,33 | 0,88 |  
    400 | 220 | 540 | 1,43 | 0,87 |  
    400 | 220 | 540 | 1,45 | 0,85 | 3 skips
        |     |     |      |      |  
4x100x2 | 220 | 480 | 1,36 | 0,91 |  
8x50x2  | 220 | 480 | 1,31 | 0,92 |  

SBS is very flexible filament. Has very low friction and good flow.
But as you can see it still have underextrusion problem when speed grows.

But look, if extrude the same amount in 4 to 8 segments with pauses the problem goes away. So, it seems like pressure build up.

Then i though. Well, how does it behave in real print. And i printed a test cube 20x20x10 with 80% infill

layer | F  | Accelartion  | w    | print | 
   -- | -- | --jerk--     | --   | time  | 
  0.2 | 40 | 500/10       | 3,45 | 9:34  | 1484.4mm (3.6cm3)
  0.4 | 40 | 500/10       | 3,45 | 7:49  | 1484.4mm (3.6cm3)
  0.4 | 80 | 500/10       | 3,45 | 4:36  | 1484.4mm (3.6cm3)
  0.4 | 80 | 2000/20      | 3,44 | 4:36  | 1484.4mm (3.6cm3)
  0.4 | 80 | 2000/20      | 3,45 | 4:36  | 1484.4mm (3.6cm3)

As i thought, since there is accelatation/decelation happens pretty often the pressure does not build up.
Then i thought what is i have model with longs walls.
And i printed 100x20x5 mm test with 80% infill too. 0.4mm layer,accel/jerk 2000/20
The test at 40mm/sec weighted 9,06g
At 80mm/sec it became 8.92

I have to notice here that i do not know the correct weight because at 40mm/sec there is a possibility of overextrusion. It it just a relative comparison point.

This is a test for SBS. For PLA, i am sure, the result will be mode dramatic as it does not flow very well and pressure builds up faster and stronger.

The filament feed rate in test prints.
Layer 0.4, width 0.7 -> s=0,28 mm2
Speed 40: 0.28*40=11 mm3
filaments s=2.4
feed rate: 16/2.4=4,6 mm/sec

For speed 80mm/sec: 9.3 mm/sec

PLA at 200C starts to skip at 6mm/sec. SBS at 220C does not skip until 9mm/sec contstant extrusion, but does not skip at real print (too short extrusion). ABS should be somewhere in between.

So, it seems like for models with many corners and not so long lines the problem virtually not present. However, for models with longer walls it does pose a problem.

@thinkyhead
Copy link
Member

Hmm, so that's a small difference, but still significant. A 2% reduction in mass at double the speed. I find it mildly amusing that the solution is to feed more into the extruder, thus increasing the pressure even more. But, it is perfectly sensible to mitigate against this effect nevertheless.

I'll see about adding M592 and borrow the formula given on reprap wiki:

(1 + min(L, A * v + B * sq(v))) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.

@ArtemKuchin
Copy link
Author

ArtemKuchin commented Mar 2, 2018

2% is for SBS, which flows very well. Probably even less error for TPU, for example.
For PLA my measured error is over 8%
Also, i print and tested all this with 0.6nozzle, for smaller nozzle (for 0.4mm for example) the error probably grows faster than linear.

Implementing the formula will be a good start.

But i think it is wrong way. Good first order (even half order :) approximation, but not nearly as accurate as it should be. The error here that at start, when pressure in the nozzle is low no compensation is needed at all. If speed was reduced then pressure also dropped and less compensation is needed. So. the formula probably helps, but will give error.

The formula considers the Vneeded as a function of Vspecified
Vneeded=f(Vspecified)
But actually in realilty
Vneeded=f(p);
where p is current pressure in the nozzle
and to me it seems like current p depends on previous pressure, distance, time, Vspecified.
Basically p depend on "amount of material in", "amount of material out".
So, IMHO, the correct way to go about speed compensation is to constantly track pressure in the nozzle. Since we cannot measure it in anyway then we can have a mathematical model of what is going on and
calculate the new expected pressure on each segment and based on that compensate for the speed.
For example, we start at zero pressure. Then we push some material to the nozzle, but we know that at some pressure the nozzle can only extrude so much, so material is left in the nozzle and increases the pressure. I have no idea about physics math in here, but i am sure the coefficients and formula can be modeled from some test.

However, i still need to see the test prints with LIN ADVANCE enabled. As it allowed pressure release before decelaration, so, any extra buildup will be naturally release as overextrusion in some places, but it might the error amount of error as formula provides or even less with finely tune V and K.

The paradox that we need to increase pressure to get the needed speed actually comes from the fact that we are printing to fast. If we printed at speeds at which pressure cannot build up we would not have such problem. Or at least at speed where problem is not noticeable. But it is too slow. For PLA and 0.4 nozzle probably up to of 30mm/sec.

@ArtemKuchin
Copy link
Author

One more thought on test with LIN ADVANCE
On long lines i actually expect to seen underextrusion in first half of line and over extrusion in the second part when pressure is naturally released when LIN ADVANCE stops pushing the filament.
I will change the nozzle to 0.4 and filament to PLA to make the problem more visible.
But i will not be able to do test until monday-tuesday.

@AnHardt
Copy link
Member

AnHardt commented Mar 2, 2018

I still wonder if AUTOTEMP could improve the situation.
AUTOTEMP tries to put extra energy, into the heater system, as soon as possible, depending on the amount of material to melt.
PID has to wait until the temperature is dropping before it can increase the heating, while AUTOTEMP tries to put in energy before the temperature is dropping.

How does the temperature behave during your tests?

@AnHardt
Copy link
Member

AnHardt commented Mar 2, 2018

By the way

#if ENABLED(AUTOTEMP)

  void Planner::autotemp_M104_M109() {
    autotemp_enabled = parser.seen('F');
    if (autotemp_enabled) autotemp_factor = parser.value_celsius_diff();
    if (parser.seen('S')) autotemp_min = parser.value_celsius();
    if (parser.seen('B')) autotemp_max = parser.value_celsius();
  }

#endif

autotemp_factor is not in celsius. It's a dimensionless factor.

@ArtemKuchin
Copy link
Author

@AnHardt I was observing temperature in the tests, also was expecting some drop, but no, T is very stable.
As i have shown in the original test rising temperature does help a lot, to the limit where error is negligible. So, autotemp might help a lot. Need to test it. Especially AUTO TEMP+LIN ADVANCE together.
However, I am pretty sure changing temperature constantly during the print will affect at least the surface quality.

@Sebastianv650
Copy link
Contributor

But actually in realilty Vneeded=f(p);

Exactly what I thought 👍 If this is caused by some material creeping due to the extrusion force, the extrusion velocity is an indication but only part of the problem.
Such a feature might build up on LIN_ADVANCE, as we know the nozzle pressure already if it's enabled. It's linear to the amount of executed advance steps, so we have that in "realtime". But I'm not sure if this is realy helpful, as I don't think we should compensate for that effect inside the stepper ISR. When calculating a new extrusion length like it's done using the flow factor inside the planner, this one calculated factor will be applied constantly along acceleration, cruising and deceleration phase. This means we have the problem again that we start with 0 pressure (if we come from full stop), accelerate to some pressure and decelerating to 0 again.
Another thing to consider when implementing this is that it isn't allowed to influence LIN_ADVANCE. LA needs the intended extrusion length from slicer which is the length we realy extrude. This new feature would calculate a bigger extrusion length, but that's only a "virtual" value as it isn't realy extruded.

Regarding autotemp, I'm not too optimistic. Speeds are changing within seconds from infill to perimeter for example, while our hotends are quite lazy. And the time amount for look-ahead with a 16 blocks buffer can be very low.

@SimonSolar2C
Copy link

extrusiontestsgcode
extrusiontests
Many clever people commenting here - just want to add an observation and a test anyone can run.
I was trying to find out what is the maximum speed of my printer's extrusion, and developed this test of measuring extrusion width at various speeds. Was surprised to see the results were not linear up to a point, but degraded from 10mm/s to 120mm/s.
Strangely my upgrade to genuine E3D did not help. Tightening the extruder pressure screws had improvement. Its now understood why corners have too much material in them.
Ive been thinking for ages that some fudge factor is needed. Keen to try this M592
I tried to fix this using linear advance v1.1 without much improvement.
Looking forward to the release of LA 1.5 !

@mh-dm
Copy link
Contributor

mh-dm commented Feb 14, 2019

Here's some real world data and a simple method to calibrate/check that should further prove the utility of this feature. I measured the amount of 1.75mm PLA filament actually extruded on an Ender 3 at various extrusion speeds (on the extruder side!) when the hotend is at 210C (at which I get good adhesion and barely any strings). I'm using a stock Ender 3 calibrated earlier at 95 Esteps / mm and marking the filament at 130mm away from the extruder, sending the G92 E0; G1 E100 Fspeed command to extrude 100mm then measuring the distance to the filament mark I made earlier (as is done in usual extruder / ESteps calibration guides). Meanwhile I'm checking that the extruder gear doesn't skip (it didn't seem to). I've tried to be as consistent as possible including around timing which affects amount of oozing.
The speed I've selected to test reflect my real world testing: 30, 40, 60, 80, 100, 120 mm/min which, if you do the math, correspond to printing at roughly 15mm/s to 60mm/s with 0.2mm layers, 0.4mm nozzle/width and 1.75mm filament (area of filament * 30mm/min is about 0.2*0.4 * 15mm/s). The lower bound comes from my configured jerk of 15mm/s (since 20mm/s jerk results in ringing from X axis even after adjusting belt tightness, though Y axis was fine, go figure).

Requesting extruding 100mm, I get at:
30mm/min | 99.63mm
40mm/min | 99.51mm
60mm/min | 99.05mm
80mm/min | 98.40mm
100mm/min | 97.96mm
120mm/min | 97.40mm
(Note that while I've used a precision caliper and tried to be consistent, I'm sure there were measuring errors)

This partly explains the weird combination of over-extruding (small walls on full bottom layers) and under-extruding (larger inner walls at 50mm/s) I've gotten in my test prints.

Even a simple "extrude 0.00025 * speed more per mm" would bring down the extrusion errors from 2% to 5-10x less and allow for a later good extrusion rate/flow calibration (set in the slicer).

Final note: I believe I'm getting more linear like results than SimonSolar2C since there are fewer variables at play in my test setup than in theirs.

@dewi-ny-je
Copy link

Someone in this thread mentioned that the cause of the issue is unknown. Well, in http://www.extrudable.me/2013/04/18/exploring-extrusion-variability-and-limits/ a photo is provided which shows that the teeth marks get closer when the filament is pushed faster.
In other words the nonlinear extrusion is the result of plastic deformation of the filament.

@thinkyhead
Copy link
Member

shows that the teeth marks get closer when the filament is pushed faster

It's my understanding that the springiness of the filament and the increased back-pressure of faster motion causes a more pronounced spring back (or slippage) as the filament is pushed at a faster rate. You can test this theory by instead lowering the hotend temperature so that the filament is harder to push, and you should see the same symptom, with the tooth-marks getting closer together as the temperature gets lower.

@timmeh87
Copy link

Guys, I came across this thread and I decided I wanted to add nonlinear extrusion to Marlin and do some real world testing. Maybe I will make a PR if it works well. My goal is transparently supporting M592 in the same way as Duet

I am halfway there, I have added the M592 command to the command parser, and Im comfortable enough in C++ to find a place to store the parameters and stuff (I am also looking at the Duet3D RepRap firmware code which is also on Github, and the command parser is similar, so its pretty easy)

But I need to know exactly where in the Marlin code to tie the nonlinear extrusion values into the extruder speed. The movement planner looks kind of complex. Im afraid I'm going to break my printer with a ridiculous movement.

It should be a really simple addition, in Duet3d it is only a few lines. I was hoping some guru could just point me to the exact spot. For reference in Duet3D it does this (just to show how easy it should be)

#if SUPPORT_NONLINEAR_EXTRUSION
	// Add the nonlinear extrusion correction to totalExtrusion
	if (dda.flags.isPrintingMove)
	{
		float a, b, limit;
		if (reprap.GetPlatform().GetExtrusionCoefficients(extruder, a, b, limit))
		{
			const float averageExtrusionSpeed = (extrusionRequired * StepTimer::StepClockRate)/dda.clocksNeeded;
			const float factor = 1.0 + min<float>((averageExtrusionSpeed * a) + (averageExtrusionSpeed * averageExtrusionSpeed * b), limit);
			extrusionRequired *= factor;
		}
	}
#endif

I am working from the 1.1.9 marlin code.

@LCameron
Copy link

Guys, I came across this thread and I decided I wanted to add nonlinear extrusion to Marlin and do some real world testing. Maybe I will make a PR if it works well. My goal is transparently supporting M592 in the same way as Duet

I am halfway there, I have added the M592 command to the command parser, and Im comfortable enough in C++ to find a place to store the parameters and stuff (I am also looking at the Duet3D RepRap firmware code which is also on Github, and the command parser is similar, so its pretty easy)

But I need to know exactly where in the Marlin code to tie the nonlinear extrusion values into the extruder speed. The movement planner looks kind of complex. Im afraid I'm going to break my printer with a ridiculous movement.

It should be a really simple addition, in Duet3d it is only a few lines. I was hoping some guru could just point me to the exact spot. For reference in Duet3D it does this (just to show how easy it should be)

#if SUPPORT_NONLINEAR_EXTRUSION
	// Add the nonlinear extrusion correction to totalExtrusion
	if (dda.flags.isPrintingMove)
	{
		float a, b, limit;
		if (reprap.GetPlatform().GetExtrusionCoefficients(extruder, a, b, limit))
		{
			const float averageExtrusionSpeed = (extrusionRequired * StepTimer::StepClockRate)/dda.clocksNeeded;
			const float factor = 1.0 + min<float>((averageExtrusionSpeed * a) + (averageExtrusionSpeed * averageExtrusionSpeed * b), limit);
			extrusionRequired *= factor;
		}
	}
#endif

I am working from the 1.1.9 marlin code.

Do you have a git repo for your changes?
Keen to help and test.

@timmeh87
Copy link

I made this post a while ago, and no one replied to it so I moved on to other things. I am still interested in having this feature and I have a CR-10 to test ideas on, but I was unable to confidently locate the part of the code to actually change and I was too nervous to totally screw up the motion of my printer. What we need to move forward is for someone to locate the line of code inside the movement planner that needs to be changed. Its really a simple request to someone who understands the movement planner, and I can make a repro with code once we have and idea of what changes to actually make. I dont know if we can tag someone for visibility here? Obviously this thread is inactive and no one has read it in a year

@thisiskeithb
Copy link
Member

A PR has been opened for this feature:

@KimmoHop
Copy link

KimmoHop commented Aug 2, 2023

(Sorry, I do see this issue is already closed :))
I'm surprised none raised CNC Kitchen (YT) and his tests.
IMO correction is already on a slippery slope, and as each hotend-extruder combo has maximum flow and slip will increase as it is approached. Maximum flow is "hard" limit, it can't be exceeded (without changing parts, filament or nozzle temperature) no matter how much extrusion you request for.
Correction might help in some (corner) cases, higher flowing hotend or filament (or higher nozzle temperature) would work as well or better. Extruder to some extent, but if filament does not have time to melt properly, well, it's debatable :D

@timmeh87
Copy link

timmeh87 commented Aug 2, 2023 via email

@abortz
Copy link
Contributor

abortz commented Aug 3, 2023

@KimmoHop what are your concerns about doing this sort of correction? Of course you can't use it to exceed the point where your extruder starts misbehaving or skipping, but I and others (including CNC Kitchen) have data that show that underextrusion starts well before that point. For whatever reason that occurs (heat flow issues, backpressure, gears slipping on filament, gears compressing filament, etc.) it can be corrected fairly easily. My experience with my implementation of this feature has been very good so far, especially with flexible materials like TPU.

@timmeh87 not sure how you can fix "flow" by looking at the flow view in your slicer, but if you don't have any problems any more, great! It would still be great if others could try it out now that there's an implementation, so we can get more data on the usefulness of the feature and the model parameterization we should use. I have only 1 printer with 1 extruder and can't predict how other extruders (especially Bowden setups!) will behave.

@gudvinr
Copy link

gudvinr commented Aug 13, 2023

@abortz wouldn't that increase internal stress in resulting parts?

If conditions are the same (i.e. temperature, hotend, extruder, plastic, etc are not changing) and only variable is extrusion speed, then reduction in plastic that exits the nozzle likely caused by the fact that plastic doesn't absorb heat as quick anymore and viscosity is reduced. If less plastic getting extruded, then what's probably happening is pressure build up inside the nozzle.

When you try to push harder to compensate for underextrusion, you increase amount of plastic, sure, but that doesn't resolve core issue that introduces underextrusion. But that potentially introduces additional stress which might make parts prone to warping and stuff like that.

I am not sure what would be a "real" solution to this but if lower viscosity is the reason, then compensation should be done by providing more heat to the plastic.
I am specifically avoid saying "increasing temperature" because temperature is instantaneous metric and thermistor reading at higher flow rates clearly provides wrong picture about what's happening inside filament core.

Since MPCTEMP already does somewhat physically correct temperature modelling, I guess @tombrazier might have a thing or two to say about that too.

@abortz
Copy link
Contributor

abortz commented Aug 13, 2023

@gudvinr I see. That is definitely an alternate hypothesis for what's going on.

Even if everything is working ideally though, I think we still expect to see increased pressure inside the nozzle area due to the higher flow rate. My operating assumption has been that this increased pressure is interfering with the extruder's ability to push filament, somehow. Possibly slipping of gears on filament, or compression of filament between gear teeth or between the extruder and the hot area. If the problem is purely upstream of the hot area, then just pushing more material shouldn't introduce any new issues.

My testing has already been with MPCTEMP enabled and the correct heat capacities for filaments, and is for relatively steady-state extrusions (100mm at constant speed), so I doubt there's a good fix for this at the temperature level. Besides, temperature control seems way to slow to deal with changing extrusion speeds. I think if its a heat flow issue as you hypothesize, and just pushing the right amount of material through the nozzle causes print quality issues, then the problem is just unsolvable by software. I haven't seen increased stress or warping, but I don't have nearly enough data, and my extruder setup only requires modest nonlinear compensation values.

I'd be really interested to see data for a standard- vs CHT-style nozzle, which in theory has much better heat transfer to the filament!

@timmeh87
Copy link

timmeh87 commented Aug 13, 2023 via email

@gudvinr
Copy link

gudvinr commented Aug 13, 2023

@abortz

Besides, temperature control seems way to slow to deal with changing extrusion speeds.

I think you're correct about that. Pumping power won't help with that due to it being very slow. Maybe CHC will have better responsiveness but cooling back to normal after you ramp up power will be slow in either case.

In that case, since we only care about filament being adequately viscous, I wonder if better model is possible.
From what I see in MPC docs it seems that it does have feedrate correction:

The effect of filament feedrate on heat-loss to the filament. Filament is assumed to be at the same temperature as the ambient air.

I am not sure how exactly it is done there. But maybe on higher feed rates it's just not aggressive enough?

@tombrazier
Copy link
Contributor

tombrazier commented Aug 13, 2023

I believe there are two different effects going on, which are visible in the videos that Stefan and others have made. It is particularly apparent in the blue line in this screenshot from one of Stefan's videos

Screenshot_2023-08-13_20-00-52

Up until about 30mm^3/s there is a gradual drop-off in flow rate as nozzle pressure builds. This is the back pressure from squeezing melted plastic through a small hole and is, in fact, the pressure that linear advance creates to ensure even flow. After 30mm^3/s there is a sudden extra drop in flow rate. I think this is where the unmelted core begins to reach the nozzle and block it and it is far more aggressive, like turning off a tap.

Attempting to force not-fully-melted filament through the nozzle will likely result in stresses in the part which will cause bad prints even if you manage to get the extrusion rate you wanted. Stefan suggests in one of his videos that this is why his meander prints fail at high extrusion rates.

I suspect this PR is best for targeting the earlier, more gradual slope.

As it happens I have an extruder which is particularly prone to reduced extrusion rate with increased back-pressure. I have recently done a lot of testing with variations on the VDE-100 and have found the same as Stefan. As pressure builds, flow rate reduces gradually but there comes a cut-off point where it starts to reduce dramatically.

CHT helps resolve this problem by increasing heat transfer to the filament and, thereby, pushing the cut-off point to a higher flow rate. The same general shape of graph results but the cut-off point comes later. I have also observed, incidentally, that the Chinese CHT clones I have tried actually significantly increase back-pressure at lower flow rates. Even when modified to be more like the genuine CHT nozzles (i.e. with a sharp edge at the center between the three holes rather than a flat face) these nozzles are worse than normal nozzles at low flow rates. But at higher flow rates they perform a lot better.

With the VDE-100 it is fairly easy to see why flow rate decreases with back-pressure. The VDE-100 acts like a die, tapping a helical thread onto the filament and then using this thread to feed the filament like a screw. As back pressure increases, the shape of the helical groove widens. More and more instead of feeding filament, the extruder distorts the filament and if back pressure is high enough flow stops entirely and the extruder just makes a circular ring around the perimeter of the filament. It looks like the result of a plough wheel cutting through a field, with a plouged groove running parallel to a mound of material that has been pushed out of the furrow. I suspect a close examination of the pattern left by a toothed drive gear would show something similar.

(In defence of VDE-100 I should add that I now have a design that has a lot more actual contact with the filament and which performs more like gear extruders. But that's another story.)

Moving on, the flow rate modelling in MPC exists for temperature stability, not to increase heat transfer to the filament. When filament melts, it absorbs heat. The more filament that is melting, the more heat that is absorbed and so the more power that needs to be delivered to the heater. Rather than waiting for the nozzle to cool because of increased rate of melting and only then responding by increasing power, MPC increases it straight away, knowing that it is going to be needed. The AUTOTEMP feature in Marlin, on the other hand, actually increases the target temperature for the extruder when flow rate is projected to increase. This will result in increased heat transfer and can be part of the solution to the unmelted filament problem. It is a different feature to MPC but can work with MPC (and PID).

@abortz
Copy link
Contributor

abortz commented Aug 13, 2023

Yup @tombrazier, Stefan's graphs are actually very deceptive due to the choice of axis. If you actually graph commanded vs actual flow rate, where his graphs take a sharp dive, you'll frequently see that the actual flow rate flattens or even goes down relative to the last data point, despite higher commanded flow rate. This is almost certainly a different effect than what was happening at lower flow rates, and regardless, why would you ever try to operate in that regime? You could get the same actual flow rate with a lower commanded one, and less weirdness to boot. :-)

@tombrazier
Copy link
Contributor

I saw this too. If fact when I pushed the limits, I would tend to get an oscillation where the flow rate would repeatedly drop and then increase again once I commanded it past a certain limit. My guess is that unmelted filament closed the hole in the nozzle, which caused back-pressure to build up until the extrusion became very slow, distorting the helical thread and causing the cutting edge briefly to get stuck in the rut that was created. This gave time for the unmelted filament to melt and extrusion then resumed and the cycle repeated. I could imagine a geared extruder getting to the point where it was stripping filament thus reducing extrusion force for a short time and causing the same kind of oscillation.

@mh-dm
Copy link
Contributor

mh-dm commented Aug 14, 2023

The main benefit of nonlinear extrusion/M592 is allowing for higher quality prints even when using higher than usual extrusion flows. I.e. better quality (in this case means much reduced under-extrusion when printing fast) for faster prints. It will NOT allow pushing past nozzle extrusion limits (which seem highly discussed and focused on in this thread).

I've measured the extrusion flow vs extrusion speed on my Ender-3 (modded, bimetal heat break, high temp thermal paste) and plotted it. The test procedure is basically the same as CNCKitchen's - extrude then weigh the sample with a 0.01g scale.

extrusion-plot

My 0.4mm and 0.6mm nozzles look limited to 15mm^3/s and 20mm^3/s respectively (at a ~normal printing temperature). For up to those extrusion speeds values only I've done a manual linear fit (i.e. M592 Aonly) and quadratic fit (M592 Bonly, seems to fit slightly better). Regardless of options, either way M592 could correct most if not all the currently significant under-extrusion at close to 15mm^3/s extrusion speeds.

@tombrazier
Copy link
Contributor

Mihai is your X axis in commanded speed or actual speed? I suspect commanded speed.

@timmeh87
Copy link

timmeh87 commented Aug 14, 2023 via email

@mh-dm
Copy link
Contributor

mh-dm commented Aug 14, 2023

@tombrazier Yes, the graph X axis is in commanded speed (/flow). I have a dual gear extruder so even I was surprised that (on the data points shown) the extruder motor wasn't skipping. I thought that would be the weakest link.
@timmeh87 The filament is the weakest link. The extruder gears are turning the right speed but because of backpressure the gear teeth don't quite mesh with the filament at the normal spacing. It doesn't go not because it can't bypass the nozzle but because it can (partially) bypass the extruder gears.

@tombrazier
Copy link
Contributor

It has suddenly occurred to me that I have been being unfair to my VDE-100 extruder. I have been measuring underextrusion against actual flow rate. Here's a graph showing various permutations of the VDE-100 against commanded flow rate in mm^3/2:

Screenshot_2023-08-16_11-10-49

The best one compares reasonably well with Mihai's data and that's with a clone CHT nozzle which has higher back pressure at lower flow rates.

@mh-dm
Copy link
Contributor

mh-dm commented Aug 17, 2023

@thisiskeithb Can this issue be re-opened? #26127 is not merged in yet.

@thisiskeithb
Copy link
Member

Feature requests are closed when related PRs are opened. If there are issues with code in the proposed PR, please post comments over there.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: Feature Request Features requested by users.
Projects
None yet
Development

No branches or pull requests