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
Strange bug with a pause (irregular) #858
Comments
This might absolutly not be related to your problem but on my side SD-Printing is buggy rightnow. I maintain some very old repetier fork for some special brand printer using repetier firmware and ATMEGA2560. What bug? My first try was to check the code all the way down from gcode to move_cache. Then I made an output of all variables order to see if arrays are in close vincinity of the movecache or coordinate variables. Rightnow I disabled SD-Support by default. I would need more time to try to reproduce the bug. I know that I would need drymode tests, gcodes echoing, probably a simple test with the old sd-lib ... Sadly no solution from me, but I wanted to share my experience after reading your problem. I liked that someone else debugged into kind of the same code. Maybe it is connected in the end. Greetings |
Hello, I understood why it arises: I am sure that this is due to the kinematics of the delta. it occurs if you interrupt printing between processing lines with long distances. In fact, I solved the problem: I had to rewrite a little pause logic, as well as the extruder behavior logic during a pause. I added a couple of new features to Printer.cpp for an extruder and modified part of the SDCard.cpp code. The pause is now processed after the cache is empty to zero. At least it works fine on my printer. P.S. I found some more bugs in the firmware. They are associated with printing through a card.I fixed them and are testing now. Also added a couple of its functionality. Printer delta, arduino due + ruramps4d, dev 1.0.4 (downloaded from github) |
Sorry, but I do not understand what you mean with "interrupting between lines with long distances". Did you check in eeprom if the new park position was defined with good values. If you have nan there it might be a move that never ends or is very slow... Especially since you said the wait never returns and buffer is 3. |
I mean the G code commands that go in series. If you put a pause while the next command is processed and there is a big waiting time (> 1 sec) between the commands, a failure occurs. |
You mean if you are called inside a waiting queue to get a place where lcd commands gets added in between I guess. Then the commands get inserted and then the next move will be inserted. Need to check but that would in deed a bad position. So maybe your solution might be a good point to see what worked and see if that is good or if there is a better alternative. In any case it is not trivial I guess. Maybe with sd commands we should only execute a command if buffer has at least one position free. Still leaves homing for example which is also bad to interrupt. |
that's how i fixed it SDCard.cpp
in Command.cpp
thus, the pause is performed only after the buffer is cleared. |
Looks in deed a bit like a solution similar to what I understood. Difference is that you just wait for the moves to finish to run the pause. I think that is a better solution that what I had in mind. You cut the source for new commands and simply wait for them to finish before running the pause script. I think that is a elegant solution to the problem that I will copy. Thanks for it. |
I found some more bugs. I can share a few more fixes |
Any fix is welcome:-) |
I will send it to you via my work email |
Hello, I found a firmware bug, it appears when pausing the printer while printing from SD
It is very difficult to catch, but because of it you can kill many hours printing
The point is this: when I try to pause the printer at a certain moment, the extruder parks,
But however starts to behave inadequately and begins to return to the starting position of the last command.
In this case the extruder starts to rotate strongly.
I could not fix it, but I found the following:
When I tried to catch the bug, I decided to duplicate the line "Commands :: waitUntilEndOfAllBuffers ();"
//--------SDCard.cpp-------String 163-----------------
void SDCard::pausePrint(bool intern) {
if (!sdactive)
return;
sdmode = 2; // finish running line
Printer::setMenuMode(MENU_MODE_PAUSED, true);
#if !defined(DISABLE_PRINTMODE_ON_PAUSE) || DISABLE_PRINTMODE_ON_PAUSE == 1
Printer::setPrinting(false);
#endif
#if NEW_COMMUNICATION
GCodeSource::removeSource(&sdSource);
#endif
if (EVENT_SD_PAUSE_START(intern)) {
if (intern) {
Commands::waitUntilEndOfAllBuffers(); //---------------------------------- wait until the buffer clears
// sdmode = 0; // why ?
Printer::MemoryPosition();
Printer::moveToReal(IGNORE_COORDINATE, IGNORE_COORDINATE,
IGNORE_COORDINATE,
Printer::memoryE - RETRACT_ON_PAUSE,
Printer::maxFeedrate[E_AXIS] / 2);
Printer::moveToParkPosition();
Commands::waitUntilEndOfAllBuffers(); //<---------------------------------------- (Buf: 3) ????, why are there still commands in the buffer at this point
Printer::lastCmdPos[X_AXIS] = Printer::currentPosition[X_AXIS];
Printer::lastCmdPos[Y_AXIS] = Printer::currentPosition[Y_AXIS];
Printer::lastCmdPos[Z_AXIS] = Printer::currentPosition[Z_AXIS];
GCode::executeFString(PSTR(PAUSE_START_COMMANDS));
}
}
EVENT_SD_PAUSE_END(intern);
}
//--end Code-------------------------------
The added line in the normal mode does not interfere with printing to pause, however, in case of an emergency, the firmware “sticks” and it cannot finish pausing.
After a certain time interval the display of the printer returns to the main screen. The screen shows that the buffer is not empty (Buf: 3).
Consequently, several commands remain in the buffer and interfere with the normal pause.
Printer delta, firmware 1.04 dev
The text was updated successfully, but these errors were encountered: