1 (edited by tealvince 2014-03-26 02:38:05)

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.
http://www.soliforum.com/misc.php?action=pun_attachment&item=4927
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.

Post's attachments

1395801292474.jpg
1395801292474.jpg 999.13 kb, 5 downloads since 2014-03-26 

SolidoodleMarlin-Vince.zip 206.25 kb, 81 downloads since 2014-03-26 

You don't have the permssions to download the attachments of this post.

2

Re: Firmware mods to rescue and resume failed prints

Nice stuff - will have a poke around myself a bit laters..
Did you consider using the M600/M601/M602 mods that would otherwise offer similar functionality ?

3

Re: Firmware mods to rescue and resume failed prints

adrian wrote:

Nice stuff - will have a poke around myself a bit laters..
Did you consider using the M600/M601/M602 mods that would otherwise offer similar functionality ?

Yes.  In fact i used the M600 code for reference when adding my pause/resume changes.  However, the M600 code primarily handles filament changes and seems to be meant for imbedding those changes at specific places in a print, I wanted to extend the concept to be fully interactive with an LCD (even without a PC) and work with any axis so a similar operation could be used at any point an operator noticed a clog/shift/break problem in a print.  I was surprised after seeing the M600 code that the pause/resume menus did not reset the current e-position in the same way, since one of the most common reasons for pausing a print is presumably to change the filament.

The feature that I think is most potentially useful, however, is the "Resume from SD" menu I added, which essentially automates the process of measuring the z-height and splitting up a cgode file at the right place when needing to resume a partial print.  That's normally a pain to do, especially when printing files from an SD card with no computer handy to edit the file. 

The intention was to make the process much more like resuming a DVD, where you can simply back up to where you last were and hit "Play" to resume.  As a bonus, since the code still processes the non-motion codes in the skipped part of the file, any temperature or other settings should be restored, which wouldn't occur if a gcode file were simply started in the middle.  I might have missed a code or two, but I used it last night to resume a print that stopped midway from a clog and I found it super convenient.

4

Re: Firmware mods to rescue and resume failed prints

Hi my name is  Bill  I recently got SD 3   and tried to add T3P3 Panelolu2  but have had issues would you be inclined to help?

SD3, RAMPS 1.4, Lawsy's carriages modified by me, 2 SSRs, E3D V6, 2 Power supplies, Independent monitoring of both power supplies (amps and volts) also extruder and bed temps, Blue Tooth connectivity, bearings in all axis & rotational points, Y axis direct drive.  Remotely controlled power box on / off . Gecko Tec build plate . Renamed FrankenDoodle

5

Re: Firmware mods to rescue and resume failed prints

slimstar2 wrote:

Hi my name is  Bill  I recently got SD 3   and tried to add T3P3 Panelolu2  but have had issues would you be inclined to help?

Not sure I can be of much help but if you post what you're experiencing I am sure somebody will be able to.  Ive just been able to figure out what I need by reading the source code.

6 (edited by slimstar2 2014-03-30 03:34:19)

Re: Firmware mods to rescue and resume failed prints

I am assuming you are using a panelolu2  on a solidoodle 2 or 3? from the piciture. If am wrong I apologizes for taking your time . If I am right  maybe you could tell how yuo got them to work . I can't get mine to upload  I just got my panelolu 2 from Think 3d print 3d and my SD 3 at Xmas . My motherboard says rev E   but looks slightly different that the one pictured in T3 P3 website .

This is what it says after trying to upload

       Binary sketch size: 48542 bytes (of a 130048 byte maximum)
            Connecting to programmer:  .
            Found programmer: Id  = “B u “; type = .
                Software Version =  .;Hardware Version = .
            avrdude: error:  buffered memory access not supported. Maybe it isn’t
            a butterfly/AVR109 but a AVR910 device?

This with the T3P3 branch of Marlin they sent me to via a link


      Thank you      Bill D.

SD3, RAMPS 1.4, Lawsy's carriages modified by me, 2 SSRs, E3D V6, 2 Power supplies, Independent monitoring of both power supplies (amps and volts) also extruder and bed temps, Blue Tooth connectivity, bearings in all axis & rotational points, Y axis direct drive.  Remotely controlled power box on / off . Gecko Tec build plate . Renamed FrankenDoodle

7

Re: Firmware mods to rescue and resume failed prints

The Solidoodle Printrboard Rev E comes with an HID bootloader. You cannot upload firmware through arduino or avrdude. You either have to use the method mentioned in the wiki:

http://wiki.solidoodle.com/update-firmware

or use a programmer on the ISP port, like a usbtiny.

Chuck Bittner is a quadriplegic gamer who is petitioning the major console developers to include internal button remapping in all console games. You can help.
Sign Chuck Bittners petition

8 (edited by tealvince 2014-03-30 16:05:13)

Re: Firmware mods to rescue and resume failed prints

Programming issues aside, your compiled firmware also looks like it might be too small.  With the LCD option enabled, my marlin firmware was twice as big, which is why upgrading to a 1284p was necessary.  On a printerboard it might compile to be smaller, but I would expect it to be bigger than that

9

Re: Firmware mods to rescue and resume failed prints

Thank you Hazer 




I followed your link to the wiki  and did a test run up to
the part where I entered cmd line     I typed in  ;

hid_bootloader_cli -mmcu=at90usb1286 -w -v Marlin.cpp.hex

hit the enter key

and got this 

Teensy Loader, Command Line, Version 2.0
error reading intel hex file "Marlin.cpp.hex"

I did not have the MB plugged in to the usb cable for this test for fear of something going wrong
and not being able to use my printer at all.

I am using Arduino 0022 from the wiki page

  Thank you for your help       Bill D.

Post's attachments

Printrbot_Marlin_v1_0.pde 1.61 kb, 5 downloads since 2014-03-30 

You don't have the permssions to download the attachments of this post.
SD3, RAMPS 1.4, Lawsy's carriages modified by me, 2 SSRs, E3D V6, 2 Power supplies, Independent monitoring of both power supplies (amps and volts) also extruder and bed temps, Blue Tooth connectivity, bearings in all axis & rotational points, Y axis direct drive.  Remotely controlled power box on / off . Gecko Tec build plate . Renamed FrankenDoodle

10

Re: Firmware mods to rescue and resume failed prints

slimstar2 wrote:

Thank you Hazer 

Teensy Loader, Command Line, Version 2.0
error reading intel hex file "Marlin.cpp.hex"

If you missed it, renee just posted a fix for this:

http://www.soliforum.com/post/53271/#p53271

11

Re: Firmware mods to rescue and resume failed prints

Nice work tealvince!

12

Re: Firmware mods to rescue and resume failed prints

renee or anyone, please help i need step by step directions to get the panelolu 2 to work with SD3

I am not a programmer just a mechanic and I have pulled most of my hair out trying to get this to work but can,t     Please help

SD3, RAMPS 1.4, Lawsy's carriages modified by me, 2 SSRs, E3D V6, 2 Power supplies, Independent monitoring of both power supplies (amps and volts) also extruder and bed temps, Blue Tooth connectivity, bearings in all axis & rotational points, Y axis direct drive.  Remotely controlled power box on / off . Gecko Tec build plate . Renamed FrankenDoodle