Help with macro to sequentially purge a mixing hot end
-
Here is another question. Are user assigned names available in the object model? What I mean by that is that I've given all my tools descriptive names such as "Black", Red", "Yellow" etc using the format M563 P0 S"Black" D0:1:2:3:4:5 H1 ; Define tool 0
So what I'd like to do is have an echo statement which said "Purging Black filament". i.e. echo the tool name rather than the tool number. Doable? If so how please.
-
@deckingman
Yes.. Tryecho "purging " ^ tools[0].name ^ " filament"
-
@owend said in Help with macro to sequentially purge a mixing hot end:
@deckingman
Yes.. Tryecho "purging " ^ tools[0].name ^ " filament"
Brill !
So I could loop through the first 6 tools by doing this yes?
while iterations <6 ; run loop from 0 to 5 T{iterations} P0 ; select tool and disable any tool chnage macros echo "Purging " ^ tools[iterations].name ^ " filament" ; display message G1 E100 F300 ; extrude 100mm @5mm/sec M400 ; wait for move to complete
-
@deckingman said in Help with macro to sequentially purge a mixing hot end:
@owend said in Help with macro to sequentially purge a mixing hot end:
So I could loop through the first 6 tools by doing this yes?
while iterations <6 ; run loop from 0 to 5 T{iterations} P0 ; select tool and disable any tool chnage macros echo "Purging " ^ tools[iterations].name ^ " filament" ; display message G1 E100 F300 ; extrude 100mm @5mm/sec M400 ; wait for move to complete
Yes, that should work.
As they say in the classics.... Suck it and see -
@owend said in Help with macro to sequentially purge a mixing hot end:
.......... As they say in the classics.... Suck it and see
If it's in the classics, then it'll either be Latin or Greek in which case something like "ut sugatis et vide", or "πιπιλέ το και δες"
But, yeah I'll give that go. As this is an experimental hot end and the only one of it's kind in the world, I like to be reasonably sure that whatever I do won't cause too much damage.
Thanks for your help.
-
@deckingman
Kudos for giving the mixing monster another chance (or RRF for that matter). Let's hope it ends like a Hollywood classic, not a Greek -
@o_lampe said in Help with macro to sequentially purge a mixing hot end:
@deckingman
Kudos for giving the mixing monster another chance (or RRF for that matter). Let's hope it ends like a Hollywood classic, not a GreekThanks. The latest version still doesn't mix as well as I'd like but it's an improvement over the Diamond 5 colour and I have some ideas about how to improve the mixing further On the plus side, I can use any M6 threaded nozzle whereas the Diamond is fixed. The heat breaks are not structural elements so I can do "one handed" nozzle changes It's significantly narrower giving more X and Y movement despite having 6 imputs. It's liquid cooled whereas a Diamond needs a huge powerful (and noisy) fan. It weighs slightly less but the difference between 420 and 410 GM's is insignificant. On the downside, it's longer reducing the Z travel by about 20mm (but I have around 800mm on my machine so that's no big deal). It takes around 5 to 6 minutes to heat despite having an 80Watt heater. But because of the high thermal mass, deflected part cooling air has little effect.
-
@deckingman said in Help with macro to sequentially purge a mixing hot end:
It takes around 5 to 6 minutes to heat despite having an 80Watt heater.
Could you add a second heater, just for the initial heating?
-
@o_lampe said in Help with macro to sequentially purge a mixing hot end:
@deckingman said in Help with macro to sequentially purge a mixing hot end:
Could you add a second heater, just for the initial heating?
All things are possible but there is always a cost The trouble is that adding another heater means adding more material which increases the amount of material to be heated, etc...
The hot end could be very much smaller if it didn't have a heater or temperature sensor at all. They add much more bulk than is needed for just the filament pathways
A single heater the same physical size (it's an E3D super Volcano at around 48mm long) but higher output capacity would likely work better but then there is the risk that it would get too hot in the event of a loss of PID control (e.g.Mosfet failure).
The graph of tempertature rise is almost a straight line, with very little curvature, so I think it's simple a function of thermal mass which takes time to heat (and even longer to cool).
It's not a big deal on my machine because my bed takes even longer to heat (it's 400mm x 400mm x 10mm thick). So my "Pre=Print" Macro heats the bed to around 40 deg C, then it starts heating the hot end to around 140 during which time I home XYUVA and B, then when the nozzle is at 140 I home Z and finally complete the nozzle heating. The net result is that everything is ready to go within the time it takes to heat the bed to (say) 60 deg C. It's just a matter of choosing what bed temperature(s) to instigate the other things that need to happen before a print can be started.
-
Getting back on topic, I posed the question about how DWC handles (manual) extrusion with mixing hot ends in another thread and got the answer back from DC.
It's an undocumented feature (at least I can't find any reference to it) but transpires that using multiple "E" values in a G1 command will cause extrusion to use particular drives (extruders) regardless of the active tool or it's configured mixing ratio. This is just what I need.
I also wasn't happy with using "echo" to show messages as they only appear in the console (which might not be open), so I prefer to use M291 which gives me a "pop up" window.
This then meant that I had to use a number of "if - elif" statements inside the iterations loop which ends up not saving any lines of code, so I abandoned the use of the while loop.
I have amended my macro which now looks like this (still untested). It's "tool agnostic" in that it doesn't matter what tool is active and therefore will not change the active tool nor alter it's mixing ratio.
; purge all 6 filaments sequentially M83; make sure we are using relative extrusion ; check if tool is hot, if not set all tools to 185 if sensors.analog[1].lastReading < 185 M98 P"0:/macros/ToolTemps/ToolTemps185.g" ; set the tool temperatures to 185 ; if necessary, wait for hot end to heat while sensors.analog[1].lastReading < 185 M291 P"Waiting for hot end to heat" R"Purge All Macro" S1 T4 G4 S4 M291 P"Purging Black Filament" R"Purge All Macro" S1 T20 G1 E100:0:0:0:0:0 F300 ; extrude 100mm @5mm/sec using drive 0 M400 ; wait for move to complete M291 P"Purging Red Filament" R"Purge All Macro" S1 T20 G1 E0:100:0:0:0:0 F300 ; extrude 100mm @5mm/sec using drive 1 M400 ; wait for move to complete M291 P"Purging Yellow Filament" R"Purge All Macro" S1 T20 G1 E0:0:100:0:0:0 F300 ; extrude 100mm @5mm/sec using drive 2 M400 ; wait for move to complete M291 P"Purging Blue Filament" R"Purge All Macro" S1 T20 G1 E0:0:0:100:0:0 F300 ; extrude 100mm @5mm/sec using drive 3 M400 ; wait for move to complete M291 P"Purging Clear Filament" R"Purge All Macro" S1 T20 G1 E0:0:0:0:100:0 F300 ; extrude 100mm @5mm/sec using drive 4 M400 ; wait for move to complete M291 P"Purging White Filament" R"Purge All Macro" S1 T20 G1 E0:0:0:0:0:100 F300 ; extrude 100mm @5mm/sec using drive 0 M400 ; wait for move to complete M291 P"Purging Complete" R"Purge All Macro" S1 T5
-
[Deleted]
-
@dc42 said in Help with macro to sequentially purge a mixing hot end:
@deckingman I'm not clear why you needed to use if-elif. You can construct the string to display in M291 in much the same way as in the echo command, except that you need to use { } around it because it is a parameter to a GCode command.
The if - elif was mostly for setting G1 En:n:n:n:n:n command which is different for each of the 6 filaments to be extruded. Can that be done using a while loop without using if - elif?
Also, using tool names for the message to refer to actual filaments was not ideal IMO because it's an indirect reference (the name for tool 0 might change but not necessarily the physical filament). So I could end up with a message saying "Extruding green filament" when in fact it might be blue or yellow (because the tool named "Green" uses both Blue and Yellow filaments in equal proportions on different drives).
-
@deckingman
after a (short) while the operator won't read the messages anymore, so why not send a single message which tells the order of colors to be purged.
"purging all extruders: black, red, yellow, blue a.s.o"
If your purge macro has reached that point, it will go through the routine without stumbling. (fingers crossed)
You can add a"purge finished" message at the end to be sure. -
@o_lampe said in Help with macro to sequentially purge a mixing hot end:
@deckingman
after a (short) while the operator won't read the messages anymore, so why not send a single message which tells the order of colors to be purged.
"purging all extruders: black, red, yellow, blue a.s.o"
If your purge macro has reached that point, it will go through the routine without stumbling. (fingers crossed)
You can add a"purge finished" message at the end to be sure.Well because "the operator" is me and only me, and I will read the messages - especially if something goes amiss.
This routine will mainly be used "pre-print" and has two purposes. Firstly to purge out any filament which may have sat for too long in a heated hot end due to testing, heater tuning, or various other reasons. The second purpose is to check that all six extruders are working correctly and that there are no blockages in any of the heat breaks or filament paths prior to starting a print. If I hear strange noises during this routine or observe that there is no filament coming out of the nozzle, the message will guide me to which of the six inputs has a problem.
That's the main reason for purging one filament at a time, rather than setting the mixing ratio to equal proportions of all 6 filaments and doing one long purge. In that case, each extruder would be running at 1/6th the speed and it might be difficult to spot if there is a problem with any of them. Indeed it's quite possible that one input could be completely blocked, and the extruder had stripped the filament but otherwise appeared to be turning, but if the other 5 extruders are pushing filament though, it would be hard to spot that there is a problem.
-
@deckingman said in Help with macro to sequentially purge a mixing hot end:
@dc42 said in Help with macro to sequentially purge a mixing hot end:
@deckingman I'm not clear why you needed to use if-elif. You can construct the string to display in M291 in much the same way as in the echo command, except that you need to use { } around it because it is a parameter to a GCode command.
The if - elif was mostly for setting G1 En:n:n:n:n:n command which is different for each of the 6 filaments to be extruded. Can that be done using a while loop without using if - elif?
When we get arrays that would likely be possible but it's hard to say if it will use less code until we see how it's implemented.
It'll probably be something like
var MyArray=(0,0,0,0,0,0) ; declare an array while iterations < 6 set MyArray[iterations]=1 ; set the first value of the array G1 E{MyArray[0]^":"^MyArray[1]^":"^MyArray[2]^":"^MyArray[3]^":"^MyArray[4]^":"^MyArray[5]} ; use the array values set MyArray[iterations]=0 ; reset the value
Or if we're lucky there may be a function to pass all the array variables with a user defined delimiter.
Maybe MyArray.values(":" ) -
@owend String arrays would make things even easier would they not? Then presumably one could do G1 E( stringarray(iterations)). I'm using my phone right now so can't easily use curly or square brackets but you get the idea.