Solved 3.5.0rc1: Input shaping causes layer shifts!?
-
@dc42
My layer shifts are in random places and directions. Mine seem like it decides randomly to turn early. -
-
@adrian Can you place the gcode file on a file sharing service and make it available via that?
Have you confirmed that if you print the same part with input shaping turned off (and no other changes), that you do not see any layer shifts?
-
@NeoDue I would like to check whether extrusion issues (blobs and similar) are responsible for the layer shifts or not. This is what I propose:
- Adapt the attached macro for your machine and test it. It measures where the homing switches are found and compares this with where they should be. It doesn't seem to work very well when using stall homing, but I am hopeful that it will work fairly well on a machine with real homing switches.
- Edit your print file if necessary to remove any homing command at the end
- Remove the filaments from your machine
- Home the printer and run this macro to check it is working as expected
- Disable your filament monitors (M591 D0 S0 M591 D1 S0)
- Run the print like that, using your usual IS and PA parameters that provoke layer shifts
- When it has finished, make sure that the print head is clear of the print, then run this macro again to check whether either X or Y has shifted.
-
@gloomyandy
I’ll work on getting that code shared out.It works fine without IS on.
-
@adrian please can you do the same test that just asked NeoDue to do, i.e. run the same print without filament and use the macro to see whether either X or Y has shiftted.
-
-
@dc42 thanks! I have rewritten the file to save its data in a file:
; Parameters to control motion to sense endstops. Copy these from the homing files. var xHomingSpeed = 500 var yHomingSpeed = 320 ; uncomment and set current if stall homing is used ;var xHomingCurrentPercent = 25 ;var yHomingCurrentPercent = 25 T0 ; activate correct Tool - the one on the X axis G91 ; relative positioning G1 Z5 F360 ; get some distance between nozzle and bed / part G90 ; absolute positioning ; Go to bed centre G1 X{(move.axes[0].max + move.axes[0].min)/2} Y{(move.axes[1].max + move.axes[1].min)/2} F3000 ; Reduce currents in case we are using stall homing - uncomment if stall homing is used ; M913 X{var.xHomingCurrentPercent} Y{var.yHomingCurrentPercent} M400 ; Check Y axis if sensors.endstops[1].highEnd G1 H4 Y{move.axes[1].max+20} F{var.yHomingSpeed} echo >>"axisshiftcheck_results.txt" "Y homing error was "^{move.axes[1].machinePosition - move.axes[1].max}^"" echo "Y homing error was", move.axes[1].machinePosition - move.axes[1].max G1 Y{move.axes[1].max-20} else G1 H4 Y{move.axes[1].min-20} F{var.yHomingSpeed} echo >>"axisshiftcheck_results.txt" "Y homing error was "^{move.axes[1].machinePosition - move.axes[1].min}^"" echo "Y homing error was", move.axes[1].machinePosition - move.axes[1].min G1 Y{move.axes[1].min+20} ; Check X axis if sensors.endstops[0].highEnd G1 H4 X{move.axes[0].max+20} F{var.xHomingSpeed} echo >>"axisshiftcheck_results.txt" "X homing error was "^{move.axes[0].machinePosition - move.axes[0].max}^"" echo "X homing error was", move.axes[0].machinePosition - move.axes[0].max G1 X{move.axes[0].max-20} else G1 H4 X{move.axes[0].min-20} F{var.xHomingSpeed} echo >>"axisshiftcheck_results.txt" "X homing error was "^{move.axes[0].machinePosition - move.axes[0].min}^"" echo "X homing error was", move.axes[0].machinePosition - move.axes[0].min G1 X{move.axes[0].min+20} ; Restore motor current M400 M913 X100 Y100 M400 G91 ; relative positioning G1 Z-5 F360 ; move bed back to where it was G90 ; absolute positioning
... and have added an M98 command into the appropriate places of the print file. I will let that run tonight.
-
@dc42 1st attempt:
Y homing error was 0.000 X homing error was 0.012 Y homing error was -0.012 X homing error was -0.012
Those offsets are within the tolerance of the endstops...
I will repeat the test once or twice tomorrow, but it seems it is indeed caused by the filament.
Edit: the printer had likely IS disabled in this test, please ignore it.
-
@dc42 test prints will follow tomorrow. I finished two test runs this evening - only to find out I accidentially verified that there is no issue when IS is disabled...
-
@NeoDue said in 3.5.0rc1: Input shaping causes layer shifts!?:
Edit: In case it matters: the "test-blob" I found occurs on layer 2, 4 and 6 in the middle of the last line of the solid infill of my test part. Prusaslicer decided in its wisdom to split this line into two long pieces which are connected by two very short ones. This is the gcode that causes the blob:
; (tool position before this snippet begins: X-7.877 Y28.826)
G1 X-7.823 Y28.723 E.00266
G1 X-7.815 Y-7.037 E.75823
G1 X-7.867 Y-7.142 E.00277
G1 X-7.919 Y-7.246 E.00303
G1 X-7.922 Y-42.252 E.91196Thanks, that's useful information. I will investigate what is happening there.
-
@dc42 Okay, here is the full set of tests, three with IS off and three with IS on - it is nothing extruder related after all
test 1 (IS most likely off) Y homing error was 0.000 X homing error was 0.012 Y homing error was -0.012 X homing error was -0.012 test 2 (IS off) Y homing error was 0.000 X homing error was 0.012 Y homing error was -0.012 X homing error was -0.012 test 3 (IS off) Y homing error was -0.012 X homing error was 0.000 Y homing error was -0.012 X homing error was 0.000 test 4 (IS on) Y homing error was 0.000 X homing error was 0.012 Y homing error was -0.012 X homing error was -0.788 test 5 (IS on) Y homing error was -0.012 X homing error was 0.000 Y homing error was -0.012 X homing error was -0.012 test 6 (IS on) Y homing error was -0.012 X homing error was 0.000 Y homing error was -1.613 X homing error was -3.188
That means something still must be wrong with Input shaping... but what?
And one more thing puzzles me: the offsets measured here are quite a bit lower than the amount of layer shifts I get if I print the real part.
The only logical reason I can think of that might cause this would be that... something... related to Input Shaping causes a significant temporary loss of torque in the steppers which causes them to loose some steps in free air, but also causes them to be more vulnerable against the slightly larger blobs which then result in more lost steps? The EMF calculator says the stepper configuration is okay. I had doublechecked that when I saw increasing motor currents did tendencially rather in- than decrease the layer shift occurrances... -
@NeoDue what IS algo are you using? I haven't tested thoroughly yet but I feel ZVDD may cause more issues than MZV.
-
@oliof I used EI2 for all recent test cases here - measuring with the input shaping plugin gave me the result that either ZVDDD or EI2 should be the best two options for my printer. Which one will be ultimately the best is something I need to find out when I can finally use it
-
@NeoDue I haven't tried EI2, but I have had much less issues with MZV than with ZVD. With my squirqle test, ZVD seems to be applied somewhat more irregularly than MZV; I would suspect that the variations in speed could affect extrusion as well which might contribute to the blobbing / extrusion irregularities.
-
@oliof at least according to my tests with the accelerometer MZV seemed quite a bit less effective, that was the reason why I had discarded that one. The options the Duet offers should work after all
But I will keep that in mind, thanks for the hint.
-
@dc42 one more test: I wanted to check if the TMC stepper maybe detects skipped steps while running the test and ran a M569.2 P0:0 and P0:3 R{0x73} (i.e. read the "LOST_STEPS" register) in regular intervals during the "print".
The register stayed at 0 all the time, while your macro yielded the following result:
test 7 (IS on) Y homing error was -0.012 X homing error was 0.000 Y homing error was -0.692 X homing error was -5.600
-
@NeoDue thanks for running all those tests.
I am trying to find the cause of the blobs you reported when IS is enabled that you said you believed were caused by particular lines of code. So I've been running this print job with full debug output, using your machine configuration, with IS enabled and with IS not enabled:
; testing IS on short segments generated by PrusaSlicer M83 M302 P1 M591 D0 S0 T0 G92 E0 G92 X-7.974 Y29.422 F3000 ; set initial position ;WIDTH:0.398828 G1 F8190 G1 X-7.953 Y29.175 E.00567 ;WIDTH:0.425466 G1 X-7.932 Y28.928 E.00608 G1 X-7.877 Y28.826 E.00284 ;WIDTH:0.398828 G1 X-7.823 Y28.723 E.00266 ;WIDTH:0.37219 G1 X-7.815 Y-7.037 E.75823 ;WIDTH:0.411061 G1 X-7.867 Y-7.142 E.00277 ;WIDTH:0.449932 G1 X-7.919 Y-7.246 E.00303 G1 X-7.922 Y-42.252 E.91196
The movement commands are taken from your print file. They include the lines you thought were where the blob occurs and a few preceding lines.
What I found is that IS isn't applied to any of those moves, mostly because they are too short (which is because you have segmentation enabled). The attempt to apply IS does change one of the moves very slightly but not in a way that significantly affects the step generation. So I haven't been able to find any cause of the blob you report.
Are you absolutely certain that these are the moves where the blob occurs when you run the print job with IS enabled?
I've put a new build of RRF for the 6HC at https://www.dropbox.com/scl/fo/p0136wx04h8xf6ejwdnn9/h?rlkey=efrfwyb6o5tqid11gustz3uvy&dl=0. I don't expect this to change the behaviour significantly, except that if you execute a G92 E command with a tool selected it now clears the fraction of an extruder step that is left over from the last move, for all extruders used by the current tool. I did this so that we can get consistent results regardless of the previous printing history.
-
@dc42 thanks for the investigation! However, with the new results from your measurement macro, I fear that the whole "blob" topic was the wrong way to go anyway...
Therefore please consider the following information to be purely optional:
I had taken two videos (they probably won't help you much, but here is a link to download them anyway..) of that part of the print, one with IS on and one with IS off, and I doublechecked with those. There are indeed two possibilities that might be the culprit: first, the one I had sent you:
- starting from X-7.877 Y28.826, the print head first prints the thin long line to X-7.815 Y-7.037. Then it creates the two short lines and goes on to X-7.922 Y-42.252. At this position, the head retracts with a G10, lifts and moves back to X-7.919 Y-6.828, where it unretracts with G11 and creates a third long line to X-7.919 Y28.491.
And this third long line seems to be the second possibility where there is an issue - with IS on you hear a "crack" which, after listening to it with headphones several times, sounds more like noise from the extruder stepper to me.
During the test print, I only had managed to pause the printer after he made that third move, and I could see the larger blob where the two short segments are located. But one of the subsequent steps might be the culprit as well indeed.
-
@NeoDue the reason I wanted to investigate the blob was that it could have been caused by either incorrect extrusion or by incorrect axis movement, for example a short pause in axis movement; and incorrect axis movement is likely responsible for the layer shifts.
Investigating in depth the lines of GCode you provided has given me a better understand of what your print is doing. As a result I've identified another possible error in the code. Please can you try a print using the new files at https://www.dropbox.com/scl/fo/p0136wx04h8xf6ejwdnn9/h?rlkey=efrfwyb6o5tqid11gustz3uvy&dl=0. I'm interested both in whether there are any layer shifts, and in whether you still see the blobs that only occurred when you enable IS.
Thanks for your patience! You feedback has been invaluable to help me get this far.