Help with macro to sequentially purge a mixing hot end
-
@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.