PA asymmetry & speed sensitivity & easy way to calibrate for it
-
@bot said in PA asymmetry & speed sensitivity & easy way to calibrate for it:
Very interesting post. Thank you for taking the time to share it.
Glad to see that it was meaningful to you. Always happy to share.
In regards to these last two points, I should add a bit. I have tested this exact behaviour with a modified version of PrusaSlicer. PrusaSlicer already has a gap between the start and end of the line. In all the testing I did: gap, no gap, "extra restart distance" (though, implemented as a calculated part of the line) with gap and without gap, the best combination I found was no gap with the normal extrusion behaviour. This is, though, without PA and without any toolhead acceleration whatsoever ("jerk" aka instantaneous speed change is set above the commanded feedrate for X/Y).
I found that when compensating for the width of extrusion at the end/start of line (by adding a gap), and extruding a small amount of plastic to ensure it touches the substrate, before x/y movement begins, there was an excessive blob left at the start. When I had the gap, but no "extra restart" stationary blob, there was a more obvious defect that could be described as a gap (this is stock prusaslicer behaviour). When eliminating the stock PrusaSlicer gap, and just using the typical extrusion behaviour, the best results were achieved.
Thanks for also sharing your experience in trying to solve this issue. Your findings fit in well with what I would expect to see with regards to line starts and ends and also the state of the tools currently available to solve this. I haven't used PrusaSlicer all that much but it is helpful to know that it is also not able to solve this problem. It confirms to me that this cannot be solved at a slicer level and really has to be solved at the firmware level. How did you eliminate the standard PrusaSlicer gap you mentioned?
I still think there could be room to improve things, but your findings and suggestions about Pressure Advance seem to be more enticing to me than experimenting more with that gap and extra restart.
Yes, it seems to me you have more or less gone as far as the tools in the Duet firmware and PrusaSlicer will allow you to go. I have done the same with the Duet firmware and Simplify3D. The only way to get this solved is if Duet can give us the increased functionality with PA. There are of course also some problems that would need to be fixed on the slicer level but those can only really be addressed once the PA functionality on the firmware level is working correctly.
This is just as a point of data for you, and to help you compare and contrast any of your findings with what I observed.
Appreciated.
-
@h975 said in PA asymmetry & speed sensitivity & easy way to calibrate for it:
How did you eliminate the standard PrusaSlicer gap you mentioned?
It was a simple modification in the source code. I used to use Simplify3D, but I moved to PrusaSlicer so I could modify the slicer behaviour. PrusaSlicer has come a long way since Slic3r days, I suggest you try it out.
-
@deckingman said in PA asymmetry & speed sensitivity & easy way to calibrate for it:
@h975 Interesting hypothesis. But why have you chosen a cylinder? Given that curves are made up of multiple short segmented moves. I'm not sure how PA is implemented under those circumstances but my understanding is that PA is not applied to each small segment, the rationale being that each move is too small. But there is a cumulative effect over multiple short segments and so if my understanding is correct, PA is applied at the beginning and end of each series of short segmented moves. It's been a while since I took much notice but IIRC, that is the behaviour that I observed when I looked into it some years ago. i.e when it was first implemented and in beta testing, curves were very slow and jerky so the algorithm was refined. I seem to recall when observing the extruder behaviour with high PA values, it appeared that PA was indeed being applied to the start and end of a cylinder.
So there is a danger that what you are seeing might be a function of the algorithm that deals with how PA is applied to the short segmented moves which make up curves and which might be different to how it is applied during more usual straight line A to B moves. To my mind, using cylinders as test parts for PA adds other variables which might mask what it is you are trying to evaluate. All I am saying is be careful with the conclusions you come to.
There is a very specific reason for using the cylinder, being that it is critical to get all line starts superimposed on each other and all line ends superimposed on each other. Printing a bunch of straight lines on top of each other results in a print job (prepared with S3D) where line starts and ends are alternately superimposed on each other meaning you cannot isolate the effects at each end. While there are probably other ways (such as scripts) of preparing a print job (with straight lines) that would allow the mentioned criteria to be met, this was not a practical alternative for me since I am not a programmer and in any case the cylinder worked very well for the purpose for which it is intended.
I have considered your argument against the cylinder and after further analysis as well as testing I must conclude that the cylinder remains a valid choice of calibration profile and findings are not skewed by the effects you mention.
Looking at the PA formula on the Duet website you can see that PA is only applied during acceleration and deceleration. If the PA algorithm is in fact doing what you say it is then it would have to be producing deceleration followed by acceleration at each accumulated segment end where PA would be triggered. It would then be possible to detect the extent to which it is happening by measuring the time it takes to print two calibration cylinders (at the same speed) with either no PA or the correct PA determined by testing as per the method described in my initial post. I did a quick test on this basis (at 75mm/s) and found the printing time for both cylinders to be 60s plus or minus a few split seconds. This is more than likely simple measurement error and is in either event not enough to be significant.
-
@bot said in PA asymmetry & speed sensitivity & easy way to calibrate for it:
@h975 said in PA asymmetry & speed sensitivity & easy way to calibrate for it:
How did you eliminate the standard PrusaSlicer gap you mentioned?
It was a simple modification in the source code. I used to use Simplify3D, but I moved to PrusaSlicer so I could modify the slicer behaviour. PrusaSlicer has come a long way since Slic3r days, I suggest you try it out.
Ok, good to know, thanks! I will give it a go.
-
@h975 Have you seen this https://forum.duet3d.com/topic/25161/my-pressure-advance-calibration
That seems to me to be quite a good approach. Interestingly, the results of evaluating PA that way, does not show any clear evidence of asymmetry between acceleration and deceleration.
I remember having a discussion with DC some time ago in which he stated that when PA is applied, it is applied in such a way that the overall amount of filament extruded for any give move remained the same as if PA was not applied. So any advancement of the extruder at the start of a move is matched by an equal amount of retardation of the extruder at the end of a move. This symmetry has to be the case otherwise PA would lead to either under or over extrusion when taken for the move as a whole. Of course, altering the velocity without altering the extruder distance might be viable.
-
@deckingman said in PA asymmetry & speed sensitivity & easy way to calibrate for it:
@h975 Have you seen this https://forum.duet3d.com/topic/25161/my-pressure-advance-calibration
That seems to me to be quite a good approach. Interestingly, the results of evaluating PA that way, does not show any clear evidence of asymmetry between acceleration and deceleration.
Yes, I have. At first glance it seems like a practical method. Unfortunately I would have to disagree with your statement that it does not show any evidence of asymmetry though. As it stands that method does not seem to be isolating line starts from line ends and it is consequently not possible to assess the presence or degree of asymmetry from it. Unfortunately it also does not allow you to quantify the results by precision measurement but instead relies on a more subjective assessment of which is the best value.
That may be good enough for printing components that do not require a high degree of accuracy and with some suitable modifications to the slice job in order to allow line starts and ends to be assessed independently it could be useful for users who do not require the highest levels of accuracy. On the other hand for those users who are printing engineering components requiring accuracy in the tens of microns, it is necessary to be able to use more precise measurement tools to assess the correct PA factors.
As you can see from the table I posted earlier on, when using a method that allows for precision measurement as well as isolation of line starts and ends then it is very clear that there is indeed a large degree of asymmetry and speed sensitivity present.
I remember having a discussion with DC some time ago in which he stated that when PA is applied, it is applied in such a way that the overall amount of filament extruded for any give move remained the same as if PA was not applied. So any advancement of the extruder at the start of a move is matched by an equal amount of retardation of the extruder at the end of a move....
Yes, I believe that statement would be correct. The total amount of plastic extruded should remain the same. The equal advance and retardation is a reflection of the system as it is at present. As such, even an asymmetric PA when tuned correctly, would also deposit the same amount of plastic but it would be more accurately distributed than it is at present.
This symmetry has to be the case otherwise PA would lead to either under or over extrusion when taken for the move as a whole....
This I would have to disagree with. Depositing the correct amount of plastic over the full move does not require symmetry of the PA, it only requires that the correct length of filament is extruded. Distributing it equally from line start to end is of course the problem we have at present and that is why we need asymmetric, speed sensitive PA.
-
@h975 thanks for sharing your research.
I have prepared an input vs output velocity graph indicating what seems to be happening vs what should be happening.
Your graphs for the input velocity profile are not correct. The input velocity should jump to (PA * acceleration) at the start and thereafter be parallel to the black line until the acceleration ends, at which point the velocity should drop sharply by (PA * acceleration). You have shown this drop for the blue line, but not the initial jump. Likewise at the start of deceleration, the input velocity should drop sharply by (PA * acceleration) and then remain below and parallel to the black line until the end of deceleration.
Lastly if I calculate an actual extrusion velocity using the PA formula with a PA value of only 0.15 together with an extruder acceleration of 1750mm/s^2 and a requested extrusion speed of 2.5mm/s then the actual extrusion velocity would have to be 265mm/s which the extruder could obviously never reach.
It's actually 262.5 mm/sec. What will happen is that if the maximum extruder jerk configured using M566 is less than 262.5mm/sec (which should always be the case), the acceleration of the entire move will be reduced to bring (PA * acceleration) down to the extruder jerk limit. That's why high values of PA sometimes slow down the print, because it reduces acceleration. However, the required extruder acceleration during a printing move will typically be much lower than 1750 mm/sec^2 except perhaps when using a very large nozzle.
-
@bot said in PA asymmetry & speed sensitivity & easy way to calibrate for it:
...I found that when compensating for the width of extrusion at the end/start of line (by adding a gap), and extruding a small amount of plastic to ensure it touches the substrate, before x/y movement begins, there was an excessive blob left at the start...
After thinking about this some more I would like to comment on this particular observation. I have also seen this behavior even with PA active. If PA is inactive then this would just be accentuated a bit more. I believe that this blob left at the start is due to a residual pressure remaining in the nozzle from the end of the previous line. In the case that PA is inactive this would be due to the fact that no allowance is made to ensure pressure decay by the end of the print line. In the case of PA being active I believe this would be due to the fact that the present implementation of PA does not allow the pressure to fully decay by the end of the print line even though it does obviously allow for a greater pressure decay than when it is not active.
If you are using a retract movement at the end of lines then the pressure is momentarily relieved by it during the move to the start of the new line and then it is restored by the unretract resulting in excess pressure at the line start with resultant over-extrusion creating a blob. As such the extra restart is necessary but it gets messed up by the fact that it is done with excess pressure. In my case I was able to get rid of the blob by reducing the amount of extra restart distance used but it is not in my view the correct way of dealing with the problem.
This is why I am also saying that the implementation of the PA formula may need to be revisited. I am hoping that dc42 will shed some light on this topic also as it will help to be able to understand why there is residual pressure remaining at the end of the print line even with PA being active. The PA should really result in a complete decay of pressure by the end of a print line.
-
@dc42 said in PA asymmetry & speed sensitivity & easy way to calibrate for it:
@h975 thanks for sharing your research.
I have prepared an input vs output velocity graph indicating what seems to be happening vs what should be happening.
Your graphs for the input velocity profile are not correct. The input velocity should jump to (PA * acceleration) at the start and thereafter be parallel to the black line until the acceleration ends, at which point the velocity should drop sharply by (PA * acceleration). You have shown this drop for the blue line, but not the initial jump. Likewise at the start of deceleration, the input velocity should drop sharply by (PA * acceleration) and then remain below and parallel to the black line until the end of deceleration.
Ahh, yes looking at the PA formula again that should have been clear to me.
Lastly if I calculate an actual extrusion velocity using the PA formula with a PA value of only 0.15 together with an extruder acceleration of 1750mm/s^2 and a requested extrusion speed of 2.5mm/s then the actual extrusion velocity would have to be 265mm/s which the extruder could obviously never reach.
It's actually 262.5 mm/sec. What will happen is that if the maximum extruder jerk configured using M566 is less than 262.5mm/sec (which should always be the case), the acceleration of the entire move will be reduced to bring (PA * acceleration) down to the extruder jerk limit. That's why high values of PA sometimes slow down the print, because it reduces acceleration. However, the required extruder acceleration during a printing move will typically be much lower than 1750 mm/sec^2 except perhaps when using a very large nozzle.
Ok that should indeed be 262.5 (0.15x1750) plus the 2.5 (requested extrusion speed) coming to 265 mm/s. Based on the explanation for the implementation of the PA curve you have given me I have recalculated some values and can see that an extrusion acceleration of 1750mm/s^2 would indeed almost never be reached.
Since the entire acceleration phase is reduced to honor the jerk limit, that means that the extrusion acceleration line would end up following the same gradient set by the uncompensated acceleration line plus the PA x extrusion acceleration (which is effectively the actual extrusion jerk offset) i.e the compensated acceleration line has a constant offset to the uncompensated line. The PA factor would in fact then only determine the size of that constant offset up to the jerk limit at which point the offset would equal the jerk limit.
I have looked at how the plastic profile extrusion (such as pipe extrusion for example) industry has modelled the flow of molten plastics and what I am seeing is that the plastic flow behavior is modelled either according to the Maxwell model (simple) or the Burgers model (more complex but more accurate). For a start I believe we should follow the simple Maxwell model which models the (viscoelastic) flow as a dashpot plus spring in series. This implies that there should not be a velocity offset at the point where PA is first triggered and the offset would then increase with time to its maximum value at the point where the end of the acceleration or deceleration phase is reached. There are formulas under this model to predict the strain/deformation of the material in response to stresses but as far as I am aware these are only applicable in the linear elastic range of the material so these would not be directly usable here. All you could possibly get from those formulas is an insight into the factors determining the curve, so the rest would then still be down to calibrating the values required for an empirically determined curve. My gut feel is that the shape of that curve would take the form of y = ax^n where y is equal to the instantaneous velocity, x is the time and a is determined by the offset to the requested velocity with its origin going through zero and n would be an exponent more than likely greater than 1.
I could send you a pdf with a good whitepaper providing a good introduction to this topic if you want.
-
@h975 I don't have a lot of time to reply, but this sounds exactly right. I never had enough time to test this out more thoroughly than the simple tests I performed, but my thoughts were going in the exact same direction as you.
-
@dc42 said in PA asymmetry & speed sensitivity & easy way to calibrate for it:
... The input velocity should jump to (PA * acceleration) at the start and thereafter be parallel to the black line until the acceleration ends, at which point the velocity should drop sharply by (PA * acceleration). You have shown this drop for the blue line, but not the initial jump. Likewise at the start of deceleration, the input velocity should drop sharply by (PA * acceleration) and then remain below and parallel to the black line until the end of deceleration.
One further thing that comes to mind when considering this above implementation of the PA is that for the deceleration move, it results in a retraction of filament at the end of the deceleration phase (as already confirmed on your Wiki for PA). This retraction however will result in cutting the end of the print line short as filament is retracted before the extruder reaches the end of the line. This will also result in excess material being left in the nozzle which should have been extruded onto the print. This excess material is then pushed out ahead of the calculated extrusion volume at the start of the next line further contributing to blobbing there, and exacerbated by the velocity step change done at the beginning of the acceleration PA. This then precludes doing the stationary "extra restart" extrusion at the start of the next print line which is necessitated due to the reason outlined in the paragraph under "Line starts" in my first post at the top of the page.
I have experienced this effect of the line end being cut short when printing calibration cylinders at low speed i.e 30mm/s in this case. This effect was reducing as the print speeds were increased. This was manifested in the cutout in the cylinder wall being substantially wider at the lower print speed.
The implication is that the deceleration PA should not reduce velocity below zero but should rather reduce the extruder input velocity according to an exponential curve going through zero at the end point of the print line.
-
@h975 said in PA asymmetry & speed sensitivity & easy way to calibrate for it:
One further thing that comes to mind when considering this above implementation of the PA is that for the deceleration move, it results in a retraction of filament at the end of the deceleration phase (as already confirmed on your Wiki for PA). This retraction however will result in cutting the end of the print line short as filament is retracted before the extruder reaches the end of the line.
No it doesn't. If the PA setting is correct, then the pressure built up in the nozzle, Bowden tube and motor will continue to extrude filament. Without the extruder running in reverse, the excess pressure in the system would not be released by the end of the move, resulting in extrusion continuing after the end of the move.
-
@dc42 Yes, actually you are right about that. I have done some calculations with respect to the extruder and axis accelerations, velocities, times and distances etc in order to put some numbers to the principles so it is easier to see how these parameters relate to each other at line start and end.
What I see is that at 30mm/s print speed, the extruder must extrude a 0.067mm length of filament (1mm track, 0.24mm high) during the acceleration move (with a PA factor of 0.15 for my printer configuration) and the additional length that is pushed into the extruder for the PA compensation is 0.449mm. When the deceleration move starts at this speed the extruder switches directly to retraction during which time 0.382mm is retracted leaving a balance of 0.067mm to be extruded over the length of the deceleration. This is what it looks like for the present symmetric PA setup. For higher speeds the deceleration move would not result in an immediate retraction but would be made up of an initial deceleration followed by a retraction.
Getting back to the gap I mentioned in my previous post it must then be coming from a lack of plastic at the line start (not end, as previously thought) Reviewing the parameters I was using on that test I can see why that was happening and we should probably disregard that result from this analysis.
Lastly, while some of my reasoning (post from 21 September) was incorrect with respect to why the present implementation of the PA line is causing problems, I remain convinced that I am right in saying that this implementation of PA is responsible for some of the problems we are seeing, particularly at line starts. The reason for that is obviously a different one and I would like to present that below.
Firstly, the theory on modelling plastic flow through a nozzle as established in other plastics extrusion industries and as I presented in an earlier post. This would point to the requirement that the extruder velocity at the start of acceleration should be zero and for deceleration it should be the requested print speed and both should change from there at a faster rate than the requested rate with a step change/jerk at the end of that (but not at the start).
Secondly the mere presence of blobs at line starts (See the table I supplied in my first post for reference) indicates excess material/pressure there. Since it seems this is not due to residual pressure it has to come from somewhere else and a simple consideration of the present PA implementation with initial jerk, in itself points to the likelihood that this would be a cause of blobs. The only reason why these blobs are not always there in my view can be explained by what I outlined in my first post under the heading "Line starts".
As a simplification/starting point one may try to keep the shape of the PA curve/line linear but at the very least the starting offset would have to be eliminated. Note : This is based on the assumption that positional axis line starts and ends do not implement jerk, which I remember @dc42 saying in another post but I am not sure whether this is still the case. At corners in a print line where positional axis jerk is implemented there would obviously have to be an jerk in the PA line as well. As a final note here, in theory at least it may be possible to have a much higher jerk value for the extruder when releasing pressure than when building it and some use could possibly be made of this principle to speed up printing where jerk values cause a slowing down of the print.
In summary my request would be to make PA asymmetric and speed sensitive and to eliminate the starting offset from the PA acceleration/deceleration line at line starts and ends (at least in a beta version). This would allow for further testing to validate the theories I have put forward.