1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Full Graphics LCD Controller - Percent Complete Mod

Discussion in 'Mods and Upgrades' started by Ziggy, Dec 8, 2014.

  1. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    The Reprap Discount Full Graphics LCD Controller has a progress bar which shows the print progress when printing from SD Card.

    I've found it hard to know exactly what the progress bar is showing so I've added a percentage complete value on the graphics display.


    Just requires a simple mod to the "dogm_lcd_implementation.h" file in Marlin (bolded below), recompile and reflash.

    // SD Card Progress bar and clock
    u8g.setFont(FONT_STATUSMENU);
    if (IS_SD_PRINTING)
    {
    // Progress bar
    u8g.drawBox(55,50, (unsigned int)( (71 * card.percentDone())/100) ,2);
    // Percent complete

    u8g.setPrintPos(55,47);
    u8g.print(itostr3(card.percentDone()));
    u8g.print("%");

    }
    else {
    // do nothing
    }
    u8g.setPrintPos(82,47); // move time display to the right




    LCD_Prog.jpg
     

    Attached Files:

    #1 Ziggy, Dec 8, 2014
    Last edited by a moderator: Dec 8, 2014
    Anonymous88, Joe John, Qoo and 13 others like this.
  2. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,278
    This is awesome, keep up the good work Ziggy
     
  3. Galaxius

    Galaxius Well-Known Member

    Joined:
    Jan 18, 2014
    Messages:
    632
    Likes Received:
    342
    I've got a tone of other mods to do before programming the LCD but something I want to do is have it show the estimated time remaining instead of the time since starting.
     
  4. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    To calculate an "estimate" of time remaining is fairly straightforward. But there are lots of variables that will mean the estimate will really be more of a "guesstimate".

    But I agree, even a rough time estimate to completion would be helpful.

    I have found that having a display of the filament used/required (in cms) is also useful at times.
     
  5. Galaxius

    Galaxius Well-Known Member

    Joined:
    Jan 18, 2014
    Messages:
    632
    Likes Received:
    342
    Playing with the Full Graphic firmware is something I want to do but other mods and prints have taken priority unfortunately. Oh, and the wife lol.
     
    AJinFLA likes this.
  6. Dbeal

    Dbeal Active Member

    Joined:
    Jul 10, 2014
    Messages:
    110
    Likes Received:
    84
    My Full Graphic LCD has been ordered and should have Friday!

    NOTE- Thanks for all the help Galaxius
     
    2 people like this.
  7. Bjorn

    Bjorn Member

    Joined:
    Aug 29, 2014
    Messages:
    77
    Likes Received:
    74
    It would be nice to see which layer it is printing...

    Like running a counter after every Z increase

    But this looks very good :) good work Ziggy!
     
  8. Phat Vi

    Phat Vi New Member

    Joined:
    Apr 8, 2014
    Messages:
    29
    Likes Received:
    0
    Awesome!! Thanks a lot. This is an excellent mod :)
     
  9. Phat Vi

    Phat Vi New Member

    Joined:
    Apr 8, 2014
    Messages:
    29
    Likes Received:
    0
    Sorry for stealing your tread. Do you know how to import the estimated total print time from your host software (MatterControl) to Arduino code?
     
  10. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    The estimated time to complete needs to be calculated in the firmware on the printer. The main reason is when printing from the SD Card, only the firmware can be used to calculate the time to complete. When printing from a host, only the host can calculate the time to complete - but that estimate can be displayed by the firmware on the printer if the host has that capability.

    I have made a number of modifications to the Full Graphics Display including the calculation of estimated time to complete, status of homing endstops and length of filament used. I will post the mods in the next few days.
     

    Attached Files:

    #10 Ziggy, Jan 18, 2015
    Last edited by a moderator: Jan 18, 2015
  11. Robert Choban

    Robert Choban Active Member

    Joined:
    Aug 22, 2014
    Messages:
    279
    Likes Received:
    27
    Ziggy can these mods you made to the full graphics display be used by the XXL controller
     
  12. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    The home screen of the XXL does not have any space where the new information can be displayed. I could probably add the estimated time to complete as I am using the bottom message line to display this. Unfortunately I can't add anything else.
     
  13. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    A few notes and questions on "estimating the time to finish a print"

    None of the practical methods that can be used to estimate the time to finish a print are particularly accurate. Unfortunately, for the methods that could be more accurate, all of the information required is not available in the firmware.

    Method 1)

    Use the current pointer to the SD Card gcode file and the total filesize to calculate the print percentage complete and estimate the time to finish using the print time which has elapsed so far.

    Time To Finish = ( Elapsed Time * File Size / Current SD Card pointer ) - Elapsed Time

    - Has the advantage that elapsed time, Current pointer and File Size parameters are all available BUT only if printing from an SD Card
    - Estimate will be inaccurate if the feed rate (ie print speed) is changed during a print.
    - Estimate tends to be very inaccurate at the start of a print then improves as the percentage complete increases.
    - Estimate method assumes that current position in the gcode file is a good predictor of time required. In practice this assumption is inaccurate and varies as the print progresses.

    Overall accuracy is probably no better than around 30-40% and can be worse depending on the model being printed.


    Method 2)

    Is a variation of method 1 where the movement of the pointer in the gcode file is measured over a period (eg one minute), then the remaining time to finish is calculated using that rate as a predictor of the time required to complete the rest of the gcode file.

    Estimate to finish (in minutes) = (Remaining file to be printed / file pointer movement during one minute)

    - This method can adjust for feedrate changes during a print
    - In practice the pointer movement during a set period is not a good predictor of the rate to complete the remaining gcode file

    Overall accuracy is not much better than method 1 and can vary very widely and wildly during the print.


    Method 3)

    Use the amount of filament used as a proportion of the total filament required and estimate the time to finish using the print time which has elapsed so far.

    Estimate to finish = ( Elapsed Time * Filament Required / Filament Used ) - Elapsed Time

    - In practice this method gives a reasonably accurate estimate of the time to finish (ie within a few minutes). The reason is the filament flow (ie usage) is reasonably uniform during a print.
    - If the filament flow rate changes, the accuracy remains reasonable because the internal Marlin firmware variable for filament used does not change with the flow rate.
    - The time to finish estimate could be used and is just as accurate for both SD Card and PC based printing.

    BUT the big issue with this method is the total filament required is not known by the firmware during the print. This value needs to be provided to the firmware somehow.

    However if the total amount of filament required were known to the firmware, this method would give a reasonably accurate estimate of time to finish for both SD Card and PC based printing.

    SO if you have read this far, the question is ....

    How important is having a good estimate of time to finish ?????

    Because method 3 could be implemented but would require a special Mxxx type gcode command in the start up gcode to tell the firmware how much filament is required for the print. Alternatively an LCD command could be provided to enter this value.

    To get the total amount of filament required is actually fairly easy to determine. The last G1 F? X? Y? Exxxx.xxxx command in the print gcode file has the total filament required as xxxx.xxxx (So yes it would be possible to read the SD Card file and get this value - but that requires lots of stuffing around)

    The second best alternative is method 1 but the accuracy is fairly poor.


    Thoughts????
     
    #13 Ziggy, Jan 21, 2015
    Last edited by a moderator: Jan 21, 2015
    Joe John likes this.
  14. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,962
    Likes Received:
    7,344
    I like #3
     
    2 people like this.
  15. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    I have tested method #3 using a special M gcode in the format M601 Fxxxxx (where x is the filament required) . Works well and is simple.

    There is no pre allocated code for the amount of filament required, but the M601 gcode seemed reasonable since M600 is the "filament change" command.

    So the idea is if you add an M601 Fxxxx in the print startup gcode with the required filament, then the estimated time to finish will be displayed (and echoed via USB serial) for both SD Card and PC based printing. Otherwise the time to finish is not displayed.

    In practice you could also enter the M601 Fxxxx gcode manually from the PC at any time during the printing and the estimated time to finish will be displayed from that point onwards.

    I think this is the least intrusive way of adding an "estimated time to finish" function in the firmware. I will also raise this "filament required" gcode enhancement on Marlin Github development.
     
    6 people like this.
  16. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,962
    Likes Received:
    7,344
  17. Printed Solid

    Printed Solid Volunteer Admin
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    1,605
    Likes Received:
    1,003
    I want to use Ziggy's firmware mods on my R1 so I've included some full graphics on my current RRD order. If anyone wants one DM me and I'll set one aside for you. Price is the same as the XXL.
     
  18. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    I've now done a variety of tests using the filament used by time as a predictor of the total time to finish a print and it gives pretty good results. Typically the time to finish estimate will be within 5-10 minutes of the actual time for a two hour print. So I think the filament used by time method will generally give useful results.

    I also had a look in the Repetier Host source (the version now frozen in GitHub) at how Repetier keeps track of time to finish. RH uses the overall time to finish from the slicer output then calculates a time for each gcode command as it is executed. However this is obviously not very accurate as Repetier also has a user setting in the print configuration ("Add to comp. Print Time") where a percentage multiplier (nominal value is 8%) can be used to tweak the time estimate.

    I will post the Full Graphics LCD display mods including the time to finish mod in a separate thread.
     
    #18 Ziggy, Jan 26, 2015
    Last edited by a moderator: Jan 27, 2015
  19. BigJim4009

    BigJim4009 New Member

    Joined:
    Mar 3, 2015
    Messages:
    8
    Likes Received:
    0
  20. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,962
    Likes Received:
    7,344
    If you want it working without @Ziggy extra features for now, download your version of the firmware and update configuration.h.

    (look for this):

    // ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
    //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

    un-comment that line:

    #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
    and make sure the Arduino programmer has the library included as mentioned. Then compile and upload.

    That should get it working to a large extent. You will want to refresh it with the latest version of Ziggy's mods when he gets those back up.
     

Share This Page