Control multiple nozzles
-
I'm building a machine to print cement using an array of nozzles, currently three of them.
My goal is to move in a scanning-type fashion, moving over the print bed in straight lines, with the line of nozzles perpendicular to the motion. Then I switch the nozzles on/off where water needs to be deposited, kind of like a dot matrix printer.The nozzles/valves accept a 3.3V and/or 5V signal to open. I'm using a Duet2 Wifi board, currently with firmware 2.03.
My question now is how to best configure the Duet. Currently I have it working for one nozzle: , I connected the nozzle to the FAN1 output, disabled the fan, set up a tool that uses extruder 0 and then using M571 made the FAN1 (=P21) to turn on with the extruder. Then with G0/G1 with a Ex.xx command, the fan will turn on.
However, as far as I could find, the Duet2 Wifi only allows two extruders to be defined (M563), so I cannot perform this trick for 3 nozzles.
I have read about laser mode, but I can also not find how to control more thane one 'laser' in that mode.
I have tried as well to use M42 to just switch the nozzles on/off in between move commands, but this results in a very slow switching. It needs to be bound the G0/G1 commands for smooth/fast switching.Any ideas about the best way to approach this?
-
@arvest said in Control multiple nozzles:
currently with firmware 2.03.
I would suggest moving to RepRapFirmware 3.4.1 for the greater flexibility and conditional gcode.
As for the specific application, I'm not sure, but it would be best to start testing on modern firmware sooner than later.
-
@arvest As @Phaedrux has said, upgrading the firmware would be the first step.
As for your specific requirement, if I understand correctly you are trying to use the fans to control the nozzles/valves and don't really care about extruder stepper motors yes? That being the case, then you can indeed have 3 tools because the Duet WiFi board has 3 fans. The only reason that there is a limit of 2 extruders is because the Duet 2 WiFi only has two extruder stepper drivers. But you could define 3 tools. So tool 0 would use Extruder 0 and fan 0, tool 1 would use extruder1 and fan 1, and tool 2 would use both extruders and fan 2. You would normally set a mixing ratio for tool 2 but as we don't care about the extruders stepper motors, it isn't necessary. You can set the fan voltage to 5V I believe so that should work.
Or another approach, if all 3 nozzles will be switched simultaneously and will always be so, then you can simple define one tool with all 3 fans assigned to it. For this you will definitely need to use later firmware.
However, the fan control is via M106 and is not bound to G1/G0. So you would need to have M106 S1.0 commands to turn the fan(s) on at the appropriate points in the gcode file and M106 S0.0 to turn them off at the appropriate points.
-
@deckingman Ok, i'll upgrade the firmware asap and see if that allows for some new possibilities.
I think I didn't explain myself correctly. The problem I am having is that all nozzles need to be active all the time. While the print head makes a scanning move, along the path I need to repeatatly open/close each nozzle (not necessarily at the same time), without any delays/slow down of the printhead.
I guess using different tools would not be the cleanest, as then you'd have to change tool midway, which isn't a buffered command.
If I could use three extruders, one for each nozzle, I imagine the gcode could look something like:
... G1 X50 E1:0:1 ; move to X50 with nozzle 1 and 3 open, 2 is closed G1 X100 E0:1:1 ; continue moving to X100, but close nozzle 1 and open 2. Leave nozzle 3 open. ...
I hope I made myself more clear.
Is there maybe a way to create a new extruder based on a GPIO instead of a drive?
-
@arvest Hmmm........
In that case, there might be another way but it's a bit complex.
Start by defining as many tools as there are nozzle combinations but use fans as nozzle controls. We don't care about the extruder drive number but the firmware might get upset if we don't use one.
So ..
M563 P0 S"Nozzle 0" D0 F0 M563 P1 S"Nozzle 1" D0 F1 M563 P2 S"Nozzle 2" D0 F2 M563 P3 S"Nozzles 0 & 1" D0 F0:1 M563 P4 S"Nozzles 0 & 2" D0 F0:2 M563 P5 S"Nozzles 1 & 2" D0 F1:2 M563 P6 S"Nozzles 1,2 & 3" D0 F0:1:2
So now we have 7 tools with every nozzle (fan) combination apart from all off (but we can deal with that).
Then using your gcode above we would have something like:-
M106 S1.0; activate fans (nozzles) T4 ; set nozzles 0 and 2 G1 X50; This should move to X 50 with fans(nozzles) 0 and 2 open T5; set nozzles 1 and 2 M106 S1.0; reactivate fans(nozzles) - might not be necessary. G1 X100; This should move a further 50mm but with different fan (nozzle) combinations
I don't know if you would have to send the M106 command again when changing tools to use different fans - I assume you would. If so it might be more elegant to move the M106 command into the tool change macros. So whenever you change a tool, it will automatically turn on the fans. You might need to use M106 S0.0 to turn the fans off first (when the tool is finished with) before turning on the new combination.
To move without any concrete flowing, you would use M106 S0.0 and select any tool.
I have no idea if this would work - it's just theoretical.......
-
@deckingman Thanks for the reply. This is indeed something that could possibly work. I would have to do an experiment in how fast the tool change command is processed, as when I used M42 to set an GPIO output in between two G1 commands, I observed a delay.
I'll post an update when I get the chance to try this.
(Still, having an extruder set per GPIO would be the most elegant solution, still wonder if that is possible)
-
Digging around in the Firmware and documentation, got me to https://duet3d.dozuki.com/Wiki/M578 and from there to using the P parameter on the G1 command. It allows you to set a pattern of bits, mapped to GPIO pins defined in the M670 command.
This I think is exactly what I am looking for, and it seems the
SUPPORT_IOBITS
flag is enabled for the Duet2 WIFI (i.e. DuetNG), so it should work out of the box. I'll will try it as soon as I have the opportunity.