Measuring the Duet's time-left estimations
-
While staying at home and printing parts for Covid masks I decided to use the time and measuring the time-left estimations provided by the Duet (RRF 2.04).
This is the print I used to collect the data:
First the reported percentage, this is the red line in this graph below and as you see its pretty close to the ideal (blue line). (X axis is print time in secs). I presume that this comes from embedded markers by the PrusaSlicer (?)
Next are the reported time left by layer, filament and file respectively, compared to the correct value (blue line). These get wild in the first 1/3 of the print and get close enough in the second half of the print. The by-layer converges the last and the by-file gets very far at the beginning of the print.
Next I computed an estimation based on print-time-so-far and percentage and got the graph below. It also has issue at first 25% of the print
I do not know what other information the slicer passes in the gcode. For example, an estimation of the total print time, which the slicer computes anyway, would help stabilizing the estimation based on time and percentage.
BTW, this is the python script I used to collect the data during the print. It's based on http/json code I copied from danal@'s library.
#!/usr/bin/python # # Tracks Duet3d print time predictions and prints the data in CSV format. # Tested with Python 2.7.16. # Hit Ctrl-C to stop. import json import time import urllib url='http://10.0.0.9/rr_status?type=3' print 'Duet3 URL: [%s]' % url def ReportHeader(): print ','.join([ 'status', 'printer_time', 'print_time', 'layer', 'fraction', 'sec_left_layer', 'sec_left_filament', 'sec_left_file' ]) def ReportCurrentValues(): response = urllib.urlopen(url) doc = json.loads(response.read()) #print json.dumps(doc, sort_keys=False, indent=2) values = [ str(doc['status']), str(doc['time']), str(doc['printDuration']), str(doc['currentLayer']), str(doc['fractionPrinted']), str(doc['timesLeft']['layer']), str(doc['timesLeft']['filament']), str(doc['timesLeft']['file']), ] print ','.join(values) # Main ReportHeader() while True: ReportCurrentValues() time.sleep(60)
-
... The 'support remaining times' checkbox of my prusaslicer was off. Does the Duet make use of it? If so, I can repeat the measurement with the checkbox on.
-
I am fairly sure that checkbox adds an M73 commands to the G-code to cause messages to appear on the console (or LCD) of certain printers.
Duet does not support this; nor do I believe it would help your tracker in any way.
-
And, oh by the way, very cool!
Now, add python matplotlib and do it in real time on the screen
-
@Danal, when I enable that checkbox I see these minute markers with percentage and minutes left
M73 P0 R445 M73 P0 R445 M73 P0 R444 M73 P0 R443 M73 P0 R442 M73 P0 R441 M73 P1 R440 M73 P1 R439 M73 P1 R438 M73 P1 R437 M73 P2 R436 ...
Let's say that I print it with duet, any idea how to monitor the P and R values of the last M73 marker? I can preprocess the gcode file if needed.
My goal is to compare the prusaslicer percentages and time-left estimation to the actual values.
-
@Danal said in Measuring the Duet's time-left estimations:
Now, add python matplotlib and do it in real time on the screen
... or ask the DWC developers to add it to the UI in some diagnostic tab.
-
@zapta said in Measuring the Duet's time-left estimations:
@Danal, when I enable that checkbox I see these minute markers with percentage and minutes left
M73 P0 R445 M73 P0 R445 M73 P0 R444 M73 P0 R443 M73 P0 R442 M73 P0 R441 M73 P1 R440 M73 P1 R439 M73 P1 R438 M73 P1 R437 M73 P2 R436 ...
Let's say that I print it with duet, any idea how to monitor the P and R values of the last M73 marker? I can preprocess the gcode file if needed.
My goal is to compare the prusaslicer percentages and time-left estimation to the actual values.
You could change them to M117 console messages. And then copy those from the console after the print, excel, etc, etc.
-
@Danal, is there a way to poll in real time console messages via http?
-
Unfortunately, the console on Duet RRF (or RRF+DSF) is not really managed for multiple web sessions to work with each other. If a given web interface "pulls" a console message, others will miss it. This may not be a 100% accurate description, but it is very close to the way it works.
If this happens to be a 3+Pi, you could scan the 'sudo journalctl -u duetwebserver' for these messages. Maybe.
-
@zapta Thanks for the analysis. Have you compared Duet 'simulation' times to print time, too? This should be the most accurate way of calculating time remaining. We have been discussing removing the time-left-by-layer and layer stats (because it doesn't really tell you much and is usually the most inaccurate estimation); dc42 has been keen to do this for a while. I've suggested that we should implement background simulation of all files, too. They could be recalculated automatically if settings are changed, too.
Ian