-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Q] Random pauses or hesitation when printing. #2761
Comments
Is there any sort of debugging I can run, check the buffer of the screen, or anything else that might help? |
Can you try recompiling marli with these values? |
Thanks I will try that.
Those are default values. I will change the others. Is this in the documentation anywhere, seems like it kind of should be? |
I would also check the slicer for something like "Maximum Resolution" and/or "Maximum Deviation" and raise them a little. I do not know what slicer you're using, the parameters mentioned are from Cura. I remember the days when I was using Octoprint with an 8 bit mainboard printer and I had a lot of blobs on curved surfaces. Changing the values of these settings mitigated the issue. |
I am using a SKR Pro, and Simplify3D I can reduce the segments. Thanks for the tips. Seems a bit off to me that it works fine on a rambo (8bit) with a 1286 screen, but the same Gcode only hesitates on the 32 bit board and TFT. |
Waiting for this print to finish before I change the firmware for the memory tweaks. I just watched it happen again. It happened on an outline (90% speed) that was a long 4" straight line and just as it hit the corner it paused before the curves.... So not printing fast, buffer should have easily been full, hmm. This is really puzzling to me. Neither of you have seen your printers hesitate? |
I totally forgot about this issue since this TFT FW and 32 bits mainboard (and using ARC Welder). On the other hand this TFT FW has a major setback, it sends every command only after receiving "OK" from the mainboard from the previous command. I am contemplating for a while to integrate "Advanced OK" (it allows filling the mainboard's buffer with commands, not send them one by one), but giving the lack of interest from BTT towards this repository I do not feel comfortable wasting my time for nothing. It seems even the free work of the contributors is too expensive for them... I do not want to spoil the game but I do not think the suggestions of @radek8 will help because of the aforementioned reasons. |
I hear you. I have sold these screens for a while now but I only sold them to use the Marlin side. You made it so the TFT was even reliable. I really hope they give this some more attention, if not I think I will be switching out to ESP3D control direct from the board and skip the screen all together. It is a bummer though I think these screens have huge potential. They need to be more receptive to some changes, stability and customizations. I appreciate the help I get here though. I have always received sincere help. (testing the mem changes now, just need to hang out near the printer to see if I can catch some hesitations) |
I often tell BTT to merge new PR's but they are really slow at it, I even asked them to hand over the merge process to a person who develop on this but with no luck :-( /ETE-Design |
I could try and ask my BTT rep to get something looked at or pushed to the front of the list if we had something specific. I have no idea if it would do anything but I could try. Maybe, just maybe, having the request come from two sides would help. |
There is already a lot of PR who need to be merged, most of then seem to be things who need to be merged |
So I think those memory changes worked. I have been kinda busy but floating around one of the printers all day and I have not caught a single hesitation!!! Should I (or one of us) add this to the firmware changes section of the INI file? |
Just another thought... |
No, No power loss recovery. Good idea though. |
So seems like it helped I written to BTT again over messenger... A lot of PR got merged now 😀 |
Sure. |
I also noticed some stuttering. My buffers are setup even larger than suggested. I use a serial baud rate of 1M bit. Arc welder could possibly help, I will give it a try. |
A friend and I were both running a SKR Mini E3 V3 with the TFT35 V3 E3. We were both experiencing the same issue you described with pausing and blobs in the print. I changed the buffer size in Marlin to 64 but no change. I also increased the baud rate from 115200 to 250000, still no change. I finally fixed the issue on both printers by lowering the baud rate to 57600. We've been running this way for months with no issues. My best guess is apparently 115200 was too fast for the SKR to handle and causing the TFT to have to retransmit the data. Hope this helps. |
Interesting, I need to try that. As well, I think I caught another hesitation with the memory tweaks, but I am not sure. It is definitely happening much much less. I am set to 250000.... |
TFT simply sends a gcode when the printer's FW (Marlin etc...) acknowledges the gcode previously sent by TFT. There is no retransmission from TFT. The issue seems to be in Marlin (probably related to buffers and/or connection speed). Ironically, some speed improvements made on TFT fw triggered this issue on some printer's fw with an unbalanced setup |
I still have not gotten to testing the Baud rate change. I can now confirm the memory changes did not fix it. It might be slightly better but my printers still hesitate randomly. I will test the Baud rate after RMRRF. |
I also have a similar issue after updating my board's (SKR Mini E3 V3) fw to Marlin 2.1 (previously I had 2.0 and I had no problems). I also made sure to update the TFT35. Now it seems to have some kind of mess ups with the gcode being corrupted (like a missing or additional character in a command) or it just pauses randomly as described here. I tried many different buffer sizes and neither of them worked. I am going to try the lower baudrate as mentioned here. I was running at the default 115200. Edit: It didn't help. Also the problem may be just caused by me not trying to print as fast before. I was playing around with input shaping so I was trying faster speeds after the update. |
I just remembered why I haven't got working on "Advanced OK". There's a bug on SKR and SKR Mini motherboards (there might be others affected too), a bug that can be avoided only if commands are sent one by one, so "Advanced OK" would be a disaster on these motherboards. I saw the issue came up a while ago on the Marlin repo but there is no sign of anyone working on a solution. |
And how about all other boards that isen't SKR-Series? 😀 |
Each configuration that has to be taken into account during printing slows down the sending of the gcodes which itself defeats the advantages of the Advanced OK. |
@kisslorand Think you misunderstood me, make a note in the top of Config.ini like: "# Advanced_OK (in Configuration_adv.h) - Issue with SKR-Series" That shouldn't slow down sending of gcodes? |
Interesting, but serial communication is handled in hardware, not in software. The software will get a signal when a command is received completely ('\n' at the end. Then it's up to the processor to handle the command.). I personally run all serial communication at 1M bit. If a command is 40 characters long then it will take at least 10 * 40 / 57600 seconds (=7ms) to transmit. As long as you don't have data corruption I do not see any disadvantage on running the serial lines faster. |
I might have misunderstood you but the issue remains. If Advanced OK is implemented, it should be configurable (enabled/disabled) because of the problematic motherboards. If it's configurable than it adds latency in preparing the gcodes to be sent during printing which defeats the purpose of Advanced OK. The added latency will surely hurt at least the problematic motherboards, they will not benefit the advantages of Advanced OK but will be burdened by this extra latency. Only real tests can answer the dilemma, but I do not feel comfortable working huge number of hours for possible negative results, not to mention that a particular user will rip my head off accusing me I made another "useless, stupid, not necessary, full of bugs" modification to this firmware when "everything was working perfectly". |
There are a lot of such kind of lines in the project. They are place holders just to cover the meaning of all bits even if not affecting the value (as you can see comments are also provided). So this is not an issue or something to change. |
OK, I understand, so I guess the additional "Serial[port].uart->SR;" in the serial interrupt routines are also just placeholders. To me it seems that a better placeholder for: It shows that the bits need to be cleared, and that there are actually 2 bits that need to be set, not just 1. |
The comments seem quite clear to me, good job! One more thing just came to mind. |
@rondlh |
What are you doing there? I'm in Guangzhou, south China. |
On vacation with my wife and kid.
I've been there in 2009. I stood in Shamiandao Island, quite a nice place! Maybe you can take the weekend off and come to Hangzhou. On the 2nd of September we're going to watch again "Romance of Song dynasty" show in the "Song dynasty park". It's a must! I've seen it in 2015. |
I will be in the Netherlands at that time to watch some F1. |
@digant73 Serial.c
SerialConnection.c
|
I don't think this is a better solution. NOTE: with advanced_ok (real or static with tx_slots > 1) the spontaneous message handling (see at the end of parseAck.c) is not properly handled yet (they relies on condition infoHost.wait == false). Consider this limitation in case you are also testing the code from a remote host (OctoPrint, ESP3D etc...). |
You are correct, certainly the chance that to process a partial message is bigger in this case, but the message response will be faster because the idle status is always delayed by 1 serial character, and if there is no idle between messages then you will have to wait for the second message to be completely received before it has a chance to be processed, like for example when a "ok" message is followed by a temperature report. Also with long message (response M43 etc.) you have no idle in the response causing a buffer overrun. In this proposal you can start processing message as soon as a complete message is received. Update: I just benchmarked the above code to get some more insight into what practically happens. @digant73 is right, there are far more scans of incomplete messages, and most of the time the idle interrupt gives a complete message. I can see that sometimes there is more data in the buffer than is reported by the idle interrupt, but this happens mostly for temperature reports. Even with this faster scanning code a buffer underrun after a M43 cannot be prevented, that is perhaps caused by the lack of a serial write buffer (message is forwarded to ESP3D). I believe the lack of a serial write buffer is probably the biggest remaining bottleneck, currently the TFT has to wait until every single serial byte is written before the program can continue, and there is a lot of writing going on.
I'm aware if this, I use an ESP3D, and I always commented out the rx_ok check because I want these messages forwarded so I can monitor the printer temps etc. I don't see any issues with that, also OctaPrint can handle this |
pretty much sure that Of course there are many possible solutions to avoid multiple read of the same incomplete message. One light solution can make use of a new lastWIndex variable for each serial ports such as:
With this code a partial message will be read only one time until wIndex is updated by the interrupt handler (wIndex is probably updated to the end of the message or the new fragment will contain \n allowing Serial_Get to retrieve the next full message)
Do you mean you replaced:
with
? |
I don't see a big problem in processing incomplete messages. I did several prints with the code above that processes the available data as soon as anything is available, it doesn't cause any problems. The messages are short anyway, we are mostly talking about "ok P16 B3" or shorter.
Yes, I have done that for years now. This way I can monitor what is going on via the ESP3D, and the ESP3D doesn't need to send additional message to get a report that is already automatically created. |
Yes this is on Printer->TFT side where the TFT is the client receiving small reply from the server (printer). Anyway I just made the small improvement in the code (added a flag). I will push the change in minutes. Eventually you could use that updated code for testing (not essential to test advanced ok or print hesitation issue). |
@digant73 wIndex should be declared "volatile" (serial.h) this is potentially a cause of the hesitations (probably not). I implemented a simple buffered serial write algorithm and did some test (based on the 2023-06-05 code base, rx_ok bug fixed, but without the flag optimization). |
Not necessary to declare |
Please explain... |
I don't think it's a multithread application. Main thread get the control once the interrupt handler terminates. Even if the application is multithread, it doesn't change too much ( EDIT: your explanation is correct although if it was the case the effects will be very evident. I will define it as volatile just as precaution. |
Sure, the FW is not multi-threaded, and there is only a single MCU, but that's not what a volatile variable is about. |
@digant73 First of all, thank you for the great job you have done, these are great improvements, this hesitation bug has bugged me for years, and ADVANCED_OK is a great feature, this a big improvement in my view, excellent job! I just had a look at the new Serial_Get with the flag improvement, that is very smart. It helps against scanning the same uncompleted message again and again, and makes the whole (hardware dependent) serial Idle interrupt obsolete, it could be replaced with the Get_wIndex, so the incoming lines can be processed immediately when they are complete, which helps against buffer overruns. Not convinced? Here something interesting, can you find the differences? M43 (Based on IDLE interrupt, buffer overun!)(128 bytes serial write buffer, DMA based, ESP3D captured) M43 (Based on updating wIndex in Serial_Get) (128 bytes serial write buffer, DMA based, ESP3D captured) (BTW: I previously tried this, but without the serial write buffering, both messages were incomplete. M503 still doesn't work, I'm note sure why). |
I emailed my Biqu rep. Maybe that will get some eyes on #2827. No promises, I am not that big of a purchaser from them. Thank you both! |
I made more important changes to the hesitation guard resulting in even more stability improvement during print. The hesitation guard is no more static, it is dynamic now, it constantly adapts to the situation. (for ex. it adapts to the situation where in a very busy print job the user start pressing buttons, moving across menus, adjusting things; it adapts to external commands (ESP3D, terminal, etc) perturbing the print job and so on...) Fun factIn my tests I raised the hesitation guard to a high level and I couldn't make the planner buffer to starve one single slot even at 1000 mm/s (400 gcodes per second). What else?Well, PR #2825 is also included. OK but where are all these goodies?The compiled FW files can be found in my repository. |
Why not make a PR here or show your code on your side, so someone can look through it and possibly do it here? Not tying to come off rude I am just curious. |
As simple as the question is I cannot give a simple answer. You know where to reach me if you are really curious. |
There are 2 different issues here:
|
* Added ADVANCED_OK support + #2761 bugfix * added tx_slots parameter on config.ini file
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. |
While printing once or twice a print, sometimes more, the machine will stop right in the middle of printing for a second, maybe even two. No errors or anything, it leaves an ugly blob, and it just continues on. It does not happen the same place on the file or on the machine. If I had to say anything, it might happen more often during circle moves, or curves. This does not happen while using the same screens for my CNC machines.
I have 6 printers and 2 CNC's running TFT35 V3 E3 screens. I have noticed this issue for probably as long as I have used the screens, more than two years I would guess. Some screens are brand new and some are very old. I update marlin and the TFT several times a year. Some of my gcode is old and ran perfectly fine on older 1286 screens, and some of my files are new.
So I think this is either some sort of configuration issue, slicer setting, or a screen firmware bug. Any ideas?
Config,
config.zip
The text was updated successfully, but these errors were encountered: