-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
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
Fix FT Motion layer shifting #26014
Fix FT Motion layer shifting #26014
Conversation
…his PR correct this issue
… shaping mode while printing. So Remove it
I'm very curious to understand what it is about the |
I totally agree, we need to understand the mecanism leading to layer shift. I did some more testing and found few things. |
@ulendoalex |
@danbrianwhite Hi Daniel, thanks for bringing this to our attention. FT-Motion uses several sets of buffers to create the motion data; I suspect on mode / frequency change something is not handled correctly within these buffers. We'll investigate this on our end. Could you please share the gcode used to perform this test, in case we need it to replicate the issue ? |
@narno2202 do you have the failing gcode and can you upload it here? |
Here is the ringing tower gcode generated with Prusaslicer.
For now on all my tests, With these warnings and my modified code, i use FT_MOTION for all my prints with success. |
@ulendoalex are the files and info from @narno2202 sufficient? It would also be awesome if Ulendo could also test out the updates from the main Marlin repo and see if they run as expected compared to the original source. |
Ulendo just update their repository. I integrate all the |
Thank you for the files, we were able to root cause the issue. When shaping is applied, the trajectory "lags" a little behind the desired trajectory that is determined from the gcode instructions / planner. When the reset function is called, the difference in position between desired and the lagging trajectory is lost, and results in the layer shift you were seeing. I'm linking a commit with proposed updates to fix this. Not invoking reset is a potential solution as well, but there are some cases that could still cause shifting, like a drastic change in the shaper frequency (i.e. 20 Hz to 80 Hz). The linked update changes how motion for a single block left in the planner is handled - it now aims to guarantee the lagging trajectory "catches up" when needed. With the update I was able to print the ringing_towerfull file without issue. M493 S0 should be avoided / blocked during a print; there hasn't been any consideration to switching between FTM and classical motion control, so it is not expected to work. Lastly, we have been using 06-20 distribution for the past week and have not noticed any issues with the FTM implementation so far. PS: |
Thanks for jumping into the fray @ulendoalex — I had a feeling there was some part of the motion that was not completing before the mode / parameter changes, and After merging your runout-in-progress fixes from #26020 how much of this PR is still needed? Do you think we need to add anything extra to |
That's good to hear! It was a pretty big refactor to put together 9-axis and multiple extruder support, and I always worry that I'll miss something in such a conversion. The next official release is getting closer. I just have a bit more to do on the endstops refactor, then a few obscure bugs and typos to chase down, and then we'll be in the home stretch for version … 2.2.0. (Was going to be 2.1.3 but this is turning out to be a big update!) Feature-freeze is pretty much already in effect, so we'll do just a couple more weeks of testing and bug-fixes and tag the new release as soon we have a reasonable confidence level. I've been on a bit of a code modernization trip in recent weeks, but with 3D printer firmware field getting more competitive, I want this next release to be as bug-free as possible, so it's time to get back to rigorous testing and patching. |
@ulendoalex — Regarding the linked commit, it contains this line: max_intervals = FTM_BATCH_SIZE * ceil((FTM_FS / FTM_BATCH_SIZE) * 0.0f); It looks like that could simply be replaced with: max_intervals = 0; Or, have we already essentially dealt with the contents of that commit with #26020? I'm comparing these two sets of changes to see where they overlap and where they differ. |
@ulendoalex — I went ahead and brought in the linked commit S2AUlendo/MarlinCollaborative@0f55851, updating it to account for extra axes. As noted above, it appears that Please advise whether all the updates now incorporated into this PR are appropriate in light of the fact that they supplant parts of #26020, or whether some elements of both 03c0d83 and #26020 are required for completeness. |
If you want to test , i create a new branch im my repository with last Uldendo's code merged into last Marlin bugfix. I remove and change some code in marlin's original |
The concept of "during a print" is kind of tricky. A print job is considered active whenever a file on the SD Card / Flashdrive is being executed, or whenever the host has started the print job timer, or whenever the print job timer starts in response to hotend heating. Naturally, we want to allow In general, it should be very rare for a G-code file or host console to send What is it that can conceivably break if the mode is changed in-between moves during a print job, as opposed to changing modes when you're just messing about with |
Actually, at the moment |
Perhaps, i got it !!!. When
|
The pause is expected.
Is this new since integrating the fix? Could you please provide details on how to recreate this? I did not see / notice this in our testing.
You are right. It should be reverted so that it is being set.
Understood. There isn't anything in FTM modes depending on print job status. The suggestion to disable the switching was a solution to prevent the layer shift issue from happening. I see now why this isn't easily defined. Yes, I do believe something is missing that would keep the motion systems in sync. Perhaps @narno2202 has already solved it in their latest comment. I will suggest if the code to synchronize the motion systems ends up too complex that the user is instead locked in to one or the other at compile time. |
@ulendoalex , thank's for you answer. Ok for the pause at layer change. Regarding the noisy motion, It's a periodic noise which is louder when speed increase. In my memory, this was not the case before your fix and it's not present in current bugfix-2.1.x with ft_motion enabled. As said before, i merge your @thinkyhead , if you want, i can do a new PR with all these changes for better testing. |
@narno2202 I'm not having success reproducing the noise neither with a higher speed print nor high speed moves. Is there a speed at which you begin to notice it ? |
@ulendoalex , few precisions. The periodic noisy motion is not truly related to speed, it's always present and increase with speed not in frequency but in intensity (it's louder). I notice it when i merge your last code in current bugfix (no special sound in bugfix with ft_motion). If you don't notice it with your printer, could it be related to stepper drivers ? (mine are TMC2226) |
@thinkyhead , actually, i have Marlin code with Ulendo's implementation of ft_motion (far simpler than in current Marlin) and another Marlin code with only the needed functions of last Ulendo's code. The 2 versions are fully functionnal with no layer shift (frequency change ,mode change, disabling ft_motion during a print). I can do a PR for one or the other. It's up to you as i don't know which one is better. |
@narno2202 |
@RV-from-be , thank's, it's fixed in the 2 repositories. |
\
@narno2202 |
@ulendoalex, again thank's for your help. My board is a MKS Monster8 V1 with TMC 2226 stepper drivers (1 X, 2 Y, 3 Z and 1 E). There is no performance impact in my print. I have tried diiferent values for the other buffers but the better result is when i increase FTM_STEPPERCMD_BUFF_SIZE. I imagine doing a PR with your last code merged in Marlin, @thinkyhead remarks anf my mods as all the layer shifting issues ares solved for frequency and mode change. |
@narno2202
Thank you! |
|
Superseded by #26074 |
@narno2202
Finally, do you have any other printers you are testing on? I wonder if we can closer match our environments. |
@ulendoalex ,I have tried your suggestions, but the result is the same, modifying |
@narno2202 |
@ulendoalex, i try sound recording with my camera, so here are the two files. home.mp4ft_motion.mp4 |
@ulendoalex , i do more test. I apologize, the periodic noise is only heard when i do a manual move with screen's menu. No periodic noise while printing with |
@narno2202 |
I am on vacation for 2 weeks, i don’t have access to my printer. I will try
ASAP.
Le jeudi 27 juillet 2023, ulendoalex ***@***.***> a écrit :
… @ulendoalex <https://github.com/ulendoalex> , i do more test. I
apologize, the periodic noise is only heard when i do a manual move with
screen's menu. No periodic noise while printing with FT_MOTION enabled.
@narno2202 <https://github.com/narno2202>
This makes somewhat more sense, as the changes should only impact behavior
when there is one block remaining in the planner. Thanks for sharing the
audio. Would you be able to add a print statement like
"SERIAL_ECHOLN("runoutBlock call");" to "FxdTiCtrl::runoutBlock()" and
observe the serial during one of the moves ? I'd like to test if for some
reason the function is incorrectly invoked multiple times per block. If
not, I will send you a patch for the buffer management to see if it is
related to that.
—
Reply to this email directly, view it on GitHub
<#26014 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7GYKSOFFMJLPKHOYZTULL3XSJ2BPANCNFSM6AAAAAAZSBZ3B4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Description
Changing the shaper frequencies during a print causes a layer shift due to the reset of the ft-motion parameters. The calibration test print is impossible. Removing the reset flag from
M493 A
andM493 B
, restores correct motion.Benefits
Allow shaping frequencies change during print without layer shifting. Expected behavior.