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

Does not play nicely with vase mode #131

Closed
rlogiacco opened this issue Apr 3, 2020 · 42 comments
Closed

Does not play nicely with vase mode #131

rlogiacco opened this issue Apr 3, 2020 · 42 comments
Labels
status: markedForAutoClose Issue will be closed automatically status: waitingForTestFeedback type: bug Something isn't working

Comments

@rlogiacco
Copy link

In a way it makes a lot of sense, in another it made me force to disable the plugin.
When printing in vase mode the continuous change in height saturates the CPU of my Pi3 which can't cope with high detail code: the effect is the printer stutters between commands and filament extrusion becomes inconsistent.
The more details, the more surface roughness.
Issue was completely gone once the plugin got disabled.
photo_2020-04-03_17-57-07

I don't blame the plugin by itself, I know this is a consequence of the limited processing power of my octoprint server, but may be this should be better communicated or a warning issued when the Z changes are "continuos"... don't know, just wanted to report it here as it was painful to "debug".

@OllisGit
Copy link
Owner

OllisGit commented Apr 3, 2020

Thx, for reporting this issue!

Because I only have one printer and not a print farm with multiple printer-versions, it is necessary to receive such feedback from the community....and yes, it is a free open source tool done by a one-man-show and you are kind-of the "beta-tester".
If no one reports the issue, I can't create a "warning" ;-)

But in the past I already added a "warning", because I received a couple of similar issues in a short time. https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/releases/tag/1.16.0

Back to your issue:

  • What printer do you use?
  • Version of DLP, OP and Python?
  • If possible, please attach the original sliced g-code from the slicer and also the upload g-code downloaded from OctoPrint-Menu.

@OllisGit OllisGit added status: waitingForFeedback Wating for Customers feedback type: bug Something isn't working labels Apr 3, 2020
@rlogiacco
Copy link
Author

Printer is an Ender 3 running Marlin 1.1.9 with latest bugfixes.
Octoprint running is version 1.4.0, DisplayLayerProgress was 1.18.1 and Python 2.7

I don't have the original code from the slicer because I usually slice and send directly to the printer, but the attached one is the file downloaded from octoprint: if you want I can re slice the file, I'm not sure I didn't change my settings in the meanwhile....

isogrid-wastebasket_small.zip

@OllisGit OllisGit added status: inNextRelease Will be implemented/fixed in next release and removed status: waitingForFeedback Wating for Customers feedback labels Apr 6, 2020
OllisGit added a commit that referenced this issue Apr 8, 2020
Bugs
#134, #124, #128, #131, #127, #126
Enhance
#132 State-Section
101, #117 option to deactivate adding M117 layer-indicators
@OllisGit
Copy link
Owner

OllisGit commented Apr 8, 2020

Hi @rlogiacco
in the newest release 1.19.0 I changed the behaviour (switching to async) of processing the gcode during print. I think this was your issue, because the gcode was not send fast enough to the printer.

Because it is just an assumption, please test and give me a feedback.

Thx, in advance
Olli

@OllisGit OllisGit added status: waitingForTestFeedback and removed status: inNextRelease Will be implemented/fixed in next release labels Apr 8, 2020
@rlogiacco
Copy link
Author

rlogiacco commented Apr 11, 2020

I installed 1.19.1 and sadly no, that didn't change the result quality, not even partially. I believe the Pi3 doesn't have enough processing power to even scratch what would be required by this.
I can think of a few options:

  • if you can somehow identify the Z is changing very often during the initial code analysis you can disable the plugin events for those files
  • or you can limit the frequency of Z changes processed by the plugin to no more than 1 every x seconds
  • or you can avoid updating unless the Z change is above a specific (0.04 mm ?)lower limit

In the meanwhile I believe my only options will be to disable it while printing in vase mode...

@OllisGit
Copy link
Owner

Hi @rlogiacco,

last idea: Try latest development version https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/releases/download/1.20.1dev/master.zip

This version use queing-hook and is not interfering the communication between OP and Printer.
The values in the display are now a little bit behind.

@rlogiacco
Copy link
Author

Sorry for the late reply, but my printer was in upgrade mode.
I've installed the dev version, but I didn't notice any visible improvement, the printer still jumps from one line to the other like my old granpa who suffered of the Parkinson's desease.
I truly believe the best option is to disable the plugin processing when it's unable to determine the line height, which is the warning I'm getting on every "vase mode" file.

@NCBob
Copy link

NCBob commented May 12, 2020

Just wanted to leave some feedback. I do have multiple printers with a little bit of variety in terms of the Raspberry Pi's I'm running a few Pi 4's and a few Pi 3's.

I've lately been printing some items in Vase Mode and haven't had any issues like what's been described here.

The printers are Ender 3's all updated with SKR V1.3 boards running Marlin 2.0 and that might be why it's able to keep up with the continuous Z changes. I also run UBL on them all so the Z is constantly moving even on regular prints, but it might not be an issue when it's a bed leveling Z adjustment.

@rlogiacco
Copy link
Author

This is weird: I’m using Marlin 1 (latest) with a MKS GEN-L (8 bit cpu) but the difference in print quality is impressive when going base mode with the plugin enabled vs plugin disabled...
Please note the artifacts do not appear unless the surface of the vase is pretty elaborate: if there aren’t much directional changes then for me there is no artifact whatsoever (like for common lo-poly skulls or non curly vases), but for models with a lot of directional changes the plugin seems to really make a difference.
Can you share an elaborate model printing nice on your printer in vase mode with the plugin enabled? Printing the same model might help me debug the issue and solve it in case it’s on my side (sliver settings, hardware, etc...)

Thanks

@NCBob
Copy link

NCBob commented May 12, 2020

I think it would probably be better if you shared a model that you're printing in vase made that you have the layer shift on. It would be possible I don't have a model that could cause the layer shift. I'll then throw it on a couple of my printers with different combinations of motherboards and raspberry pi's and see what happens. I'll also go through and post what plug ins I've got installed.

@rlogiacco
Copy link
Author

Sure, no problem!
Here (https://www.thingiverse.com/thing:3448156) is one of the things displayed in the picture above: that print is the 0.8 version scaled down to 50% and sliced with Cura, then sent to my RPi 3 running Octopi driving an Ender 3 featuring a 0.4mm nozzle.

Thanks!

@NCBob
Copy link

NCBob commented May 12, 2020

It's printing on two of my printers and as of right now it's not having any issues. Once it completes I'll post the pictures and I'll also get a list of the plug-ins I'm using.

@NCBob
Copy link

NCBob commented May 12, 2020

well first one is done. Second one is almost done and they both look flawless. I'll post my other plugins that are installed and I don't have linear advance enabled.
DD38532C-06D1-4276-AED4-E848DBB72352

@NCBob
Copy link

NCBob commented May 12, 2020

Oh, and one machine has a raspberry pi 3 the other has a pi 4.
Here are the plugins I have installed (I always install the same plug ins on all my printers)
Action Command Prompt
BLTouch plugin
Bed visualizer
Better Heater timeout
Dashboard
DisplayLayerProgress Plugin
Friendly neighborhood beeper
Preheat button
Sidebar webcam

And I use simplify3d for all my slicing. I also don't get any warning about printing in Vase mode like you described. What slicer are you using, I can give that a try and see if it makes a difference.

@rlogiacco
Copy link
Author

I'm using Cura for Windows, latest version currently available. I have many more plugins than you have, can't get a list atm as I don't have remote access to octopi.

Regarding the warning, when I start a print sliced in vase mode I get a notification stating it is impossible to determine the layer height from the file and it advises to check the slicer settings...

@NCBob
Copy link

NCBob commented May 13, 2020

I'll give cura a try in Vase Mode, and BTW it did print fine on both my enders with both a Raspberry PI 3b+ and a Raspberry pi 4

If you could try something else, enable the DLP plugin, and then try disabling all your other plugins and see if you still have issues. If you don't then try enabling your plugins one at a time until it starts showing artifacts. It might be that a combination of DLP and another plugin is causing the issue.

I'll let you know the results of using Cura, I'll have to play around to get some good settings for it before I try the vase mode, but I'll let you know the results.

@NCBob
Copy link

NCBob commented May 15, 2020

Ok, I've been printing PPE stuff and I just switched my printer to add filament runout sensor hooked up to the pi. I started getting zits on my prints. I disabled a bunch of plugins and it's working fine now, this is one of my printers that I have a PI 3b instead of a Pi 3B+ or Pi4. I can print the same gcode file from and sd card with no problem.

I'm going to replace the Pi with a Pi 4 and see if it still has the same problems. It may just be the combination of plugins is causing the delays and pauses in the print.

As soon as I change it tonight and test it I'll post my results.

It might just be a combination of firmware, plugins that is causing the pi to not be able to send the code fast enough.

@NCBob
Copy link

NCBob commented May 18, 2020

Ok, I replaced the Pi3b with a Pi4 with the same plugins and still had stuttering. Turns out it wasn't DLP and probably not just the pi3b (although the stuttering was much less with the pi4) it was the filament runout sensor I was using connected to the GPIO pins. When I uninstalled that and hooked it up directly to the board and did the filament sensing in the firmware it's printing perfectly again.

Note, when I did the first vase print above I did not have the plugin for filament sensing installed. Now everything is running like I expected.

@OllisGit
Copy link
Owner

@NCBob great that you could solve the Problem!!! And of course that DLP wasn't the main reason.

@rlogiacco THX, for the support!!!

Instead of disabling the whole plugin, you can also disable the Printer-Display communication in the plugin-settings.
This prevents that my Plugin sends additional M117 GCode messages during the print, that (maybe) slow down the data-transfer rate during OP and the printer.

@OllisGit OllisGit reopened this May 20, 2020
@OllisGit
Copy link
Owner

I forgot to ask @rlogiacco: do you still have the issue or is there a new one?
You mentioned, that after uploading from Cura to OP a popup appears that no layer indicator is found, right?

Do you use the this plugin: https://plugins.octoprint.org/plugins/UltimakerFormatPackage/ ?

@rlogiacco
Copy link
Author

OK lads, sorry for not answering, my printer is down for maintenance and I didn't have the opportunity to run any test.

If it's not a problem I ask you to leave this open for a couple of weeks until I receive the replacement parts and I can run some tests.
I'm once again remote to my printer at the moment of writing and I'm unable to report the list of installed plugins, but I can tell you it's quite long, so I would perfectly understand it might be CPU starving effect caused by multiple plugins.
I'm not pointing my finger at this plugin for a specific reason other than that disabling it fixes the problem, but I had the feeling it was a computational power limitation since my first post.

In other words, while I do appreciate all the effort in trying to solve this, I'm still convinced the optimal solution is to reduce or prevent processing on vase mode prints: I don't think there's much value for having a periodic update in such case.

@sddev0
Copy link

sddev0 commented Jun 11, 2020

My observations are similar. In codeline 450 the updateDisplay-method is called on each and every z-change. For regular „layered“ prints this can be okay, but continuous/vase mode prints are characterized by a constant changing z-coordinate on each move.
Even if the actual workload is dispatched to a seperate working queue, the total load seems to exceed the allocable CPU resources of the pi.
Maybe a throttling could improve the situation: update on change but max. one time in n seconds. That high refresh rate is not beneficial to the user.

@OllisGit
Copy link
Owner

hmmm...unfortunately I can't reproduce the error on my ANET E10, RPi 3b+ (OP 1.3.10) printing the vase (sliced with cura with "spiral-option")
image
The max cpu usage is 25% during the print.

One idea in my mind is, that there is maybe an issue how I implement the queue. Because if the queue is empty and a new command is receiving a new Thread is created.
So, if processing of one command is fast the queue is already empty if a new command received and a new Thread is created.
If I increase the lifetime of the queue, then I can reduce the amount of creating new threads.

I will check this.

@gdachs
Copy link

gdachs commented Jun 11, 2020

I sliced it with PrusaSlicer, but I don't believe that this is an issue. I could provide the .gcode file, but it contains some Klipper macros and will not work without changes in Marlin.
If you are right with your idea, then I might suffer from that problem more than you, as the queue might get more often empty because of the speed of Klipper.

@gdachs
Copy link

gdachs commented Jun 11, 2020

Only to make it clear. As long as the bottom layers are printed everything is okay. It starts to stutter when the wall is around 10 mm. In the photo you have posted you are not high enough, but it is not clear to see.

@gdachs
Copy link

gdachs commented Jun 11, 2020

Why do you not create the queue on startup and keep it all the time?

OllisGit added a commit that referenced this issue Jun 12, 2020
@OllisGit OllisGit added status: inNextRelease Will be implemented/fixed in next release and removed status: inNextRelease Will be implemented/fixed in next release labels Jun 12, 2020
@OllisGit
Copy link
Owner

Hi,
I did some improvements in the newest release 1.22.0.
Now the Threadcount is drastically reduced.

Hopefully you can see this improvement also in your print.

Please test and give feedback.
Thx,
Olli

@sddev0
Copy link

sddev0 commented Jun 12, 2020

I will test it this weekend. But to say this clearly: I see a problem with refreshing so often. It‘s not only the thread in DisplayLayerProgress. With each call in vase mode an event is fired which may be handled by other plugins (e.g. OctoDash), the GUI is updated several ten times a second etc. Flooding the event system is not a good behavior in my opinion.

@OllisGit
Copy link
Owner

OllisGit commented Jun 12, 2020

Hi @sebadue ,

I totally agree with your opinion about sending data too often to the GUI.
Thats the reason why I only send messages to the UI if the message was really changed (independent from the fired event).

E.g. you defined a display-pattern which includes only layer-information. The progress-changed event was fired and processed by DLP, but the Layer is not changed so there is no traffic to the frontend.

I don't agree with your sentence "updated several ten times a second". Which events should cause this behaviour?
Vase-Sample: Printing one single layer takes 3-5 seconds (on my printer). In that timeframe nothing is updated in the ui, because nothing relevant is changed, maybe the progress increased once.
After that, a single Layer/Z-Change event is fired....but thats all. -> 1-3 events per layer, per 3 seconds

Maybe I missed something.

@gdachs
Copy link

gdachs commented Jun 12, 2020

@sebadue it looks like that the events are not fired on every change of Z height, that would be a problem in vase mode. Layer change and Z height change are not the same. Look at this snippet from the Julia vase gcode:

;BEFORE_LAYER_CHANGE
;1.3
G1 Z1.100 F7800.000
;AFTER_LAYER_CHANGE
;1.3
G1 F1800.000
G1 Z1.102 X144.483 Y187.260 E270.43385
G1 Z1.103 X143.829 Y186.595 E270.46543
G1 Z1.104 X143.234 Y185.928 E270.49566
G1 Z1.105 X142.992 Y185.607 E270.50929
G1 Z1.105 X142.739 Y185.312 E270.52242``` 

@sddev0
Copy link

sddev0 commented Jun 12, 2020

@gdachs & @OllisGit:
What I read from the source code is that there is a regex ("Z_HEIGHT_EXPRESSION") which every single gcode line is checked against, when it is "sending" to the printer. It matches all G0 and G1 codes which contain a "Z" value. If that expression matches, the _updateDisplay() method is called which includes event propagation etc. (codeline 441 - 451).
On your example all five "G1"-lines match as they contain a Z coordinate and this leads to an update of z-height with the reason "UPDATE_DISPLAY_REASON_HEIGHT_CHANGED". In the updateDisplay that even triggers sending an M117 to the printer, if configured.
In vase mode each and every move changes the z-height. That is no "layer"-oriented process, even though some slicers count a layer on each full revolution.
What I want to say is in vase mode each G1 move calls the update function, which is rather "expensive", because of the inherent and explicit height change.
Layer change is another topic which seems not to be involved into our performance issue, as it does not happen more often than in conventional mode.

@gdachs
Copy link

gdachs commented Jun 12, 2020

@sebadue sorry, you are right. I have thought falsely that the pattern that is used would only match BEFORE_LAYER_CHANGE. That means for me that it makes not very much sense to test the new version. I had used OctoDash and the DashBoard plugin before I disabled this plugin. Not sure what to do now? I don't print vases very often, hmm...

@OllisGit
Copy link
Owner

Hi @gdachs,
between Version 1.21.0 and 1.22.0 there is a huge improvement, because the Thread-Ressource is reused instead of creating thousand of new threads.
So the memory/cpu consumption is reduced....and if no one with the issue could re-test the new version, then I am not able to improve the behaviour!

@sebadue correct, each gcode is analysed, but already mentioned not in the same thread that OP use for sending the gcode to the printer, so sending should not be blocked. Also, ONLY if values were changed a message is sent to the display or to the eventbus. E.g. if you want to display the z value, then on each change the display is changed as well.

But it looks like that this approach is not enough. What kind of "support/fix" could I implement?

  • As suggested from you: Don't analyse the gcode for a couple of n-seconds.
  • Add a disable-button in OP-GUI to totally disable the gcode-analyse during print (prevent disable plugin and server restart)
  • .... any other suggestion?

@rlogiacco
Copy link
Author

My advise is to add a timer (5 sec?) and check if that time has passed since last z-update: If not, then do not send any notification or event.
Normal files will never be affected, vase mode files will still get updates, but at an acceptable rate.
If you also make that value configurable you get a safe next against slow processing and enable fast boards to lower it as needed.

@stale
Copy link

stale bot commented Aug 5, 2020

This issue has been automatically marked for closing, because it has not had activity in 30 days. It will be closed if no further activity occurs in 10 days.

@stale stale bot added the status: markedForAutoClose Issue will be closed automatically label Aug 5, 2020
@stale stale bot removed the status: markedForAutoClose Issue will be closed automatically label Aug 5, 2020
@krystiancharubin
Copy link

After a few hours of searching why my vase mode print quality is bad, I finally found this thread.
Like other after completely disabling DLP print quality is perfect.
IMG_20200926_002319
Left: DLP Enabled
Right: DLP Disabled

@OllisGit OllisGit added status: inNextRelease Will be implemented/fixed in next release and removed status: analysing status: waitingForTestFeedback labels Oct 7, 2020
@OllisGit
Copy link
Owner

OllisGit commented Oct 7, 2020

Hi,
the new version 1.24.0 has some improvements that could help printing in vase-mode.

First, as @rlogiacco suggested, I added a interval timer how ofter the printer display should update.
The second improvement reading plugin settings from OP, this is now much faster. Thx, @gdombiak!

Please so kind and test the new version and give a feedback.

Thx, in advance
Olli.

@OllisGit OllisGit added status: waitingForTestFeedback and removed status: inNextRelease Will be implemented/fixed in next release labels Oct 7, 2020
@stale
Copy link

stale bot commented Nov 6, 2020

This issue has been automatically marked for closing, because it has not had activity in 30 days. It will be closed if no further activity occurs in 10 days.

@stale stale bot added the status: markedForAutoClose Issue will be closed automatically label Nov 6, 2020
@stale stale bot closed this as completed Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: markedForAutoClose Issue will be closed automatically status: waitingForTestFeedback type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants