Topic: Firmware mods to rescue and resume failed prints
The last few days I've been messing with firmware, making tweaks for my own use, and wanted to share some of the mods I've come up with. A lot of this has evolved to work around clogs I've been getting with some self-extruded filament, but would be useful for any clogs and many other problems.
Some of the changes (such as setting the default z-steps-per-mm for an m3 rod) are strictly for my own hardware and preferences, but I've tried to annotate all the changes to make them easy for anybody else to cut in. I have a cheap lcd display and controller and added most options as new menus, but most of the changes could also be adapted to be called from gcode as well.
I'm going to continue to add any ideas I find interesting, and the code may be a little raw, but here is a zip of my modified source so far and the changes:
Major:
1) RESUME_PRINT_FROM_ZLEVEL
This menu option lets you start a print from and SD card file, but any axis-homing commands and all motor and extruder movements below the current z level are ignored. I use this feature to "resume" a print that stops printing due to a clog or broken filament. I just manually seek the head down to the exact top of the partial print and "resume" the same file I printed originally. It heats up normally but jumps past all the printing code until it reached the right z-level, then continues where it left off.
The code internally just sets a "floor" z level. I image you could add a gcode command to set this level to a specific value or from the current z-level so that this would work for PC-based printing as well.
2) PAUSE_AND_HEAD_UP
This extra pause menu conveniently drops the bed a preset amount after pausing to allow for nozzle cleaning with a drill bit. Importantly, I changed this and all pause menus to save the current axis positions immediately after pausing so one could seek back to that position later (more below). The move-z menu is automatically activated after pausing to allow for additional adjustments.
3) PAUSE_AND_RETRACT
Similar to above, but retracts the filament after pausing to prep for a filament change. The move-extruder menu is automatically activated so the new filament can be fed in. I lengthened the timeout value before control goes back to the main menu due to inactivity.
4) RESTORE_LAST_POSITION
When printing is paused, this menu seek all three axes back to the saved positions, even if you've manually moved the head around. This is useful to have as a separate option in case additional manual adjustments are needed, such as dropping the head down a bit to make up for layers that failed to print.
5) RESUME_FROM_LAST
Combines the above menu with a normal "resume" menu to continue printing after seeking to the last position as above. Importantly, I changed the "resume" menus to compensate for any extruder moves. Previously, I would find after resuming a print that the gcode would try to "undo" any manual filament feeding I would do after changing filament. This seemed unhelpful, so I added the compensation.
6) RESUME_FROM_HERE
This replaces the normal "resume" menu, but add offset values, if needed, to fool the printer into thinking it hasn't moved from its saved pause position. This lets you make adjustments in any direction to compensate for a shift or gap and still have the rest of the print line continue from where you tell it.
Minor Changes (probably not of general interest):
a) Added a custom welcome message
My LCD always said "Welcome Mendel" instead of "Welcome Solidoodle". The existing code looked correct, so I don't know why it was wrong, but I wanted to customize the message anyway.
b) Custom cooldown function
The previous cooldown menu used gcode but only cooled the extruder. I don't know why the bed temp wasn't also set, but I changed this to a function to explicitly set everything to 0 and that seems to work better.
c) Flattened distance menu
I never liked the extra step of having to select a movement distance since I almost always wanted 1mm movement. I put both 1mm and .1mm options in the same menu and lost the 10mm choices.
d) Preheat Safe temp
I added a menu to allow preheating the bed, but only warming the extruder to 80 degrees so it wouldn't burn the ABS if I left it in this state for a long time.
e) Prehead ABS menu
I don't print in PLA, so I took those menus out for now for me.
f) Reverse encoder direction
The thumbwheel control with my LCD controller turned in the wrong direction (clockwise for up and counterclockwise for down) so I added a switch to optionally reverse the direction.
