IDEAS Filament Change At Layer X

Discussion in 'Guides, Mods, and Upgrades' started by Spoon Unit, Apr 14, 2016.

  1. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,561
    Likes Received:
    483
    I've not fully tested this, so be warned. I think it's probably about right though, and once you've seen the trick, you can roll your own.

    There are a number of time when even 2 filaments isn't enough and you actually really just need to change the filament at a given layer in order to get the output you want. If you've already solved all your filament change woes, either by bevelling the PTFE or fitting Titan's you've still got the challenge of stopping your print whenever you want to.

    You could just go in and edit the GCODE. Presumably you don't want to do that evertime. In this example, I'm using S3D's "Additional terminal commands for post processing" box under scripts. The E3D profiles for BB come with a couple of entries in there. This is designed to go after those:

    {REPLACE "M117 Layer 3" "G91\nG0 Z1 F360\nG90\nG0 X0 Y0 F4800\nG91\nG0 Z50 F360\nM0\nG0 Z-51 F360\nG90\nG1 X70 Y200 F3000\nG1 X70 Y240 F3000\nG92 E0\nG1 E10 F50\nG1 E-1.5 F2000\nG1 X80 Y240 F3000\nG1 X80 Y200 F3000\nM117 Layer 3"}

    In this example, I'm doing a layer change before beginning Layer 3. The GCODE steps do this, and by the way, they assume you're using the left extruder (you'd need to alter the docking coordinates for the right one):

    Move up 1mm
    Move to 0,0
    Drop the bed 50mm
    Wait
    Put the bed back down 51mm
    Dock
    Prime
    Undock

    Unfortunately, it all looks a bit mashed together up there. For whatever reason, S3D didn't like having a new line so you have to use the geeky \n for a line-feed.

    I'm looking forward to testing this out. Who's with me? :)
     
  2. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,561
    Likes Received:
    483
    Not good. This is not good. Because the settings are embedded in the gcode, this ends up performing a replacement on itself. You'd think they might have though of that.
     
  3. Kanedias

    Kanedias Well-Known Member

    Joined:
    Sep 12, 2015
    Messages:
    408
    Likes Received:
    124
    Do you know is there any way to modify Marlin so when you use the pause command from the control screen it does this?
     
  4. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,561
    Likes Received:
    483
    I believe so. I think you can program in exactly what pause and resume should do. I've no experience with that. That said, as long as you remove the garbage this produces at the top of the tile, this programmed GCODE sequence does do its job exactly as intended.
     
  5. Miasmictruth

    Miasmictruth Well-Known Member

    Joined:
    Sep 4, 2015
    Messages:
    804
    Likes Received:
    118
    Can't remember if I showed this to you guys or someone else but here is a little trick I used on my old printer with one print head. Not sure if it will help you or not.

    http://www.thingiverse.com/thing:716899
     
  6. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,561
    Likes Received:
    483
    Yep. You did. I never read the details before, I just looked at the lovely print quality. Now I see you detailed the steps, and this is what I was aiming for with this. I just need to figure out how to get S3D to output that for me at the right layer changes instead of messing in the GCODE file directly.
     
  7. Miasmictruth

    Miasmictruth Well-Known Member

    Joined:
    Sep 4, 2015
    Messages:
    804
    Likes Received:
    118
    Gottcha, I haven't gotten into the the multi color prints with two nozzels, notnsure how the slicing software knows it it's changing. So can't help you there at the moment that's my next project is toblearn how multi head printing works.

    I would guess if we could add more materials to the print file we could use that to dock the print head automatically for a filament change, that should be sweet, and I am guess what your trying to do right?
     
  8. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,561
    Likes Received:
    483
    With dual head printing, you have a tool-change, and for that you use the tool-change script to dock, purge, and prime. That all works very well. I was just interested in getting to the bottom of the mechanics of coordinating a controlled filament change for a given extruder.

    With regard to your curiosity on multi-nozzle printing, what you do is supply two models, one to be printed with each nozzle. The slicing software can then be used to co-locate the models. Whenever a tool change is needed, the tool change script plays to swap printing nozzles.
     
  9. Miasmictruth

    Miasmictruth Well-Known Member

    Joined:
    Sep 4, 2015
    Messages:
    804
    Likes Received:
    118
    Could you harness that power to instead of change hotends, change filaments, then the script could just be in place of the tool change script.
     
  10. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,561
    Likes Received:
    483
    I just came back here to report that I stumbled across a way to overcome the previous issue I had with the replace script, only to find @Miasmictruth update and I really like that idea. I think it'll need a little work, with post processing. The theory here would be that you would define your printer as having extruder T0 to TN, use the tool change script to dock and switch filament (making sure not to move the head at all), and then use a post processing script to replace all non-T0 with T0. Of course, you've got to nurse your print, but for one-off-complex prints, that's fine, and if you get a pause in there, it really doesn't matter how long it takes, though of course if you miss a change, your machine is going to be sitting there with a hot end for a long time.

    Anyway, I really came to report how to work around the previous issue. The problem I had was that the replace code I had was also running on itself so-to-speak, because all the settings are thrown out into the file at the beginning. I found that you can wipe this lot out quite easily though. I looked for a setting not to output it all, but didn't find that. So in the end the processing I have is this (in english)

    • replace layer comments with LCD layer reports
    • remove all settings from the front of the file
    • replace the lcd output for layer N with the filament change code
    This is the set of post processing commands for that:
    • {REPLACE "; layer" "M117 Layer"}
    • {STRIP ";"}
    • {REPLACE "M117 Layer 4" "G91\nG0 Z1 F360\nG90\nG0 X0 Y0 F4800\nG91\nG0 Z50 F360\nM0\nG0 Z-51 F360\nG90\nG1 X70 Y200 F3000\nG1 X70 Y240 F3000\nG92 E0\nG1 E10 F50\nG1 E-1.5 F2000\nG1 X80 Y240 F3000\nG1 X80 Y200 F3000\nM117 Layer 4"}
    This example is a switch a layer 4. You could add as many of these lines as you like, changing only the layer number each time in order to stop and pause for a filament change. One word of caution: I don't recall whether in my testing I used M0 or G25 to pause. Whichever I did, the LCD didn't seem to understand we'd paused or offer me a way to resume. Fortunately octoprint did understand, and hitting resume there was the way to get going again.
     
  11. Miasmictruth

    Miasmictruth Well-Known Member

    Joined:
    Sep 4, 2015
    Messages:
    804
    Likes Received:
    118

    A note about not moving the XY, I am not sure how it will work on the Big Box, but after each color change I would home X and Y then move the head back with gcode.


    Read though your post once will have to again later when I home more time to try it out, sounds like your on to something there :)
     
  12. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,411
    Likes Received:
    735
    You gotta respect the stepper timeout when doing this.
    Steppers are powered down after 60 seconds of inactivity. Then you can move them with very little force...
    I still would recommend to have a look at the "Filament Change" option in Marlin triggered with an M600 command:
    "M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]"
    According to the Devs the steppers will not power down when doing this.
     
    Spoon Unit likes this.
  13. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,561
    Likes Received:
    483
    OK. So perhaps M600 instead of M0 and M25. I don'.t recall the steppers timing out when I did whichever I did before (I really think it was an M25) and there's no way I conducted that change in 60 seconds (unless I'm really getting that quick now at switching filament).
     
  14. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,411
    Likes Received:
    735
    You could increase that time with no problem but I still think better to try that built in solution first, maybe alter the firmware if it is not working out.
     
  15. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,411
    Likes Received:
    735

Share This Page