|
Update LCD for Graphic LCD with layer number and time remaining July 13, 2015 05:30PM |
Registered: 10 years ago Posts: 126 |
|
Re: Update LCD for Graphic LCD with layer number and time remaining July 13, 2015 06:35PM |
Registered: 10 years ago Posts: 126 |
sprintf (LCDline1, "Reading SD Card .."); u8g.setPrintPos(2,37); u8g.print(LCDline1);
|
Re: Update LCD for Graphic LCD with layer number and time remaining July 14, 2015 01:53AM |
Registered: 11 years ago Posts: 14,688 |
|
Re: Update LCD for Graphic LCD with layer number and time remaining July 14, 2015 02:24AM |
Registered: 10 years ago Posts: 126 |
// PrintLinesTotal = the number of lines in the gCode file that start with G1 and contain X
// PrintLinesCurrent = each line read from the gCode file during the printing that starts G1 and contains X
// LayerCountTotal = the number of lines in the gCode file that start with G1 and contain Z
// LayerCountCurrent = each line read from the gCode file during the printing that starts G1 and contains Z
char LCDline1[20]; // create the LCD line array with the data to be displayed
LCDline1[0] = '\0'; // clear the line to be displayed
int DHRP = 0; // integer for estimated hours remaining
int DMRP = 0; // integer for estimated minutes remaining
if(PrintLinesCurrent >= 10){ // start calcs after the first 10 lines have been printed
long CurrentPrintTime=0;
CurrentPrintTime = millis() - starttime; // calc the milliseconds that the job has been running so far
long EMR = (CurrentPrintTime / PrintLinesCurrent) * (PrintLinesTotal - PrintLinesCurrent); // calc the estimated millis remaining
int SRP = trunc(EMR / 1000); // convert remaining millis to seconds remaining for print
int MRP = trunc(SRP / 60); // convert seconds to minutes remaining for print
if(MRP < 1) MRP = 1; // keep the value at 1 minute for the last few layers when the actual value < 1 minute
if(PrintLinesTotal == PrintLinesCurrent) MRP = 0; // switch to zero when all lines printed
MYSERIAL.print("PrintLinesTotal = ");
MYSERIAL.println(PrintLinesTotal);
MYSERIAL.print("PrintLinesCurrent = ");
MYSERIAL.println(PrintLinesCurrent);
MYSERIAL.print("CurrentPrintTime = ");
MYSERIAL.println(CurrentPrintTime);
MYSERIAL.print("EMR = ");
MYSERIAL.println(EMR);
MYSERIAL.print("SRP = ");
MYSERIAL.println(SRP);
MYSERIAL.print("MRP = ");
MYSERIAL.println(MRP);
MYSERIAL.println("-------------------------------------");
DHRP = trunc(MRP / 60); // how many hours in MRP remaining for print
DMRP = MRP - (DHRP * 60); // calc remaining minutes after subtracting DHRP hours
}
sprintf (LCDline1, "L%03d/%03d e%02d:%02d", LayerCountCurrent, LayerCountTotal, DHRP, DMRP);
u8g.setPrintPos(2,37);
u8g.print(LCDline1);
|
Re: Update LCD for Graphic LCD with layer number and time remaining July 14, 2015 04:47AM |
Registered: 10 years ago Posts: 17 |
|
Re: Update LCD for Graphic LCD with layer number and time remaining July 14, 2015 05:00AM |
Registered: 10 years ago Posts: 126 |
|
Re: Update LCD for Graphic LCD with layer number and time remaining July 14, 2015 10:29AM |
Registered: 10 years ago Posts: 17 |
|
Re: Update LCD for Graphic LCD with layer number and time remaining July 14, 2015 11:47AM |
Registered: 10 years ago Posts: 126 |
Quote
atunguyd
No you will need to count positive and negative Z moves then, remember the retractions are a up and then down, so I guess if you sum up the Z moves and add them algebraically you will have the total number of layers. This however becomes difficult with gcode that is absolute as opposed to relative because a retraction would be a z move to say 6.8mm then a Z move to 6.7mm. A relative commadn would be Z 0.1mm then Z -0.1mm which I believe is very rare.
|
Re: Update LCD for Graphic LCD with layer number and time remaining July 15, 2015 03:37PM |
Registered: 10 years ago Posts: 126 |
|
Re: Update LCD for Graphic LCD with layer number and time remaining July 15, 2015 05:03PM |
Registered: 10 years ago Posts: 126 |