Welcome! Log In Create A New Profile

Advanced

Duet Ethernet - Dual Extruders - Macros/Switching Extruders

Posted by blandified 
Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 22, 2018 01:46PM
Hey all!

Background:

My team is working on making a printer that will print cells instead of plastic (bio printer) using a Duet Ethernet controller. There will be 2 syringes instead of extruders and there will be steppers that push the syringe down to "extruder" the cells in 1 syringe and a structural gel in the other syringe. There will be a slide rack system in between the 2 syringes that has a stepper attached to it. This stepper will rotate one direction and in doing so will shift one syringe up and the other down, and when the stepper rotates the opposite direction, the syringes will go down/up on the other direction (this is to ensure that the syringes won't knock over the print).

So as I understand it, when you make the 3D model you specify that there will be 2 materials used, and somewhere in the gcode reflects this. So we need to ensure that when the material needs to switch according to the 3D model that was made, we need to have our printer use the other syringe.

My thought process: When the printer is printing and going through each gcode line, it will reach a point where it needs to print from the other syringe. What I need it to do is recognize this, pause the printing process but keep ALL TEMPS constant, rotate the rack slide stepper to shift down the other syringe, offset the carriage (with both syringes) so the newly lowered syringe is in the default print location, and resume the print. It would keep alternating between the 2 syringes while printing, essentially every layer it would be switching to the other material.

I know this can be done with macros (have a macro file which uses gcode commands to control the stepper which shifts the syringes using the rack system), but I am not sure at all how to implement this.

How do I have the Duet recognize when to pause, how to pause, when and how to implement the gcode macro, resume print, etc.

I know this is a long post, but I really do appreciate you taking your time and reading this. Looking forward to your help! Thank you.

Edited 1 time(s). Last edit at 02/22/2018 02:39PM by blandified.
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 22, 2018 01:55PM
Instead of moving the target material wouldn't it be easier to move the syringes?

mount the two syringes side by side on the carriage just like the hotend would be on standard printer, the duet would be programed for this offset.
The carriage would then move on x/y to each target and perform its duties, syringe one squeeze, then #2 and then move to another target.

Put the Z movement on the bed and it only has to move maybe 20mm X axis could be several meters long with Y axis being either stable or offset by enough to do several rows...

I assume this would be put together in a hood for environmental control?

As far as pausing etc that's all going to be manual gcode programming, not hard but will take a little learning's smiling smiley
I don't know of any GUI or easy interface for such a thing....

Edited 1 time(s). Last edit at 02/22/2018 01:57PM by JustSumGuy.
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 22, 2018 02:39PM
Quote
JustSumGuy
Instead of moving the target material wouldn't it be easier to move the syringes?

mount the two syringes side by side on the carriage just like the hotend would be on standard printer, the duet would be programed for this offset.
The carriage would then move on x/y to each target and perform its duties, syringe one squeeze, then #2 and then move to another target.

Put the Z movement on the bed and it only has to move maybe 20mm X axis could be several meters long with Y axis being either stable or offset by enough to do several rows...

I assume this would be put together in a hood for environmental control?

As far as pausing etc that's all going to be manual gcode programming, not hard but will take a little learning's smiling smiley
I don't know of any GUI or easy interface for such a thing....


First off, thank you for the info!

And you are correct, I misspoke! We plan on moving the carriage with the syringes, not the material. I will update OP.

Yes it will be in a hood for environment control.

I have been reading up on the gcode and macros and all that, and I feel like I can complete the actual gcode lines for the macro. But the hardest part that I see is how to get the Duet to run this macro while printing. Any ideas?
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 22, 2018 04:30PM
I see the gcode file as the print job itself not as a macro to be run within the print job.

Do you need this to run in a loop until interrupted?

Or as a start-run-finish type job....

This is somewhat interesting to me, I did a little looking and found that conditional logic can be applied to gcode.

[www.cnccookbook.com]

I did not know you could do that smiling smiley

Question are you familiar with 3d printing or are you just starting learning how gcode works?

In 3d printing the gcode 'macro' is fully the print job from start to finish. You upload the gcode file to the print server (integrated in the case of the duet) and tell the print server to start the job.
The print server then starts handing gcode line by line to the print controller.
The print controller performs each action and waits for the next line of gcode to be delivered.

Edited 2 time(s). Last edit at 02/22/2018 04:43PM by JustSumGuy.
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 22, 2018 04:50PM
Quote
JustSumGuy
I see the gcode file as the print job itself not as a macro to be run within the print job.

Do you need this to run in a loop until interrupted?

Or as a start-run-finish type job....

This is somewhat interesting to me, I did a little looking and found that conditional logic can be applied to gcode.

[www.cnccookbook.com]

I did not know you could do that smiling smiley

Question are you familiar with 3d printing or are you just starting learning how gcode works?

In 3d printing the gcode 'macro' is fully the print job from start to finish. You upload the gcode file to the print server (integrated in the case of the duet) and tell the print server to start the job.
The print server then starts handing gcode line by line to the print controller.
The print controller performs each action and waits for the next line of gcode to be delivered.

Since this "macro" would run in the middle of a print, I guess it would be start-run-finish type of job. And thanks for that gcode looping link! I feel a bit overwhelmed by that and hope we can come up with a simple solution haha.

Honestly, our team is not very familiar with 3D printing and are just starting to learn how gcode works.


I was thinking: in the gcode file that gets uploaded, are there some sort of T (change tool) trigger that can be used to run a macro that will switch to the other syringe?

I just want to make sure I'm not over thinking it. Other 3D printers have dual extruders and they work fine, the only difference ours does is printing from one, switching to the other, and then printing from that other extruder/syringe.
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 22, 2018 05:09PM
switching tools is basic actually, don't hold me to this but if you look up M108 it should have all you need.

I think its just a matter of saying:

M108 T1 (use tool #1)

M108 T2 (use tool #2)

nope not 108 smiling smiley

I am not sure I think DC42 will have to give you more info, I cant find it in this doc:
[duet3d.dozuki.com]

but essentially it should be a simple command to switch tools.

G10 sets tool offset smiling smiley I found that lol

Edited 2 time(s). Last edit at 02/22/2018 05:24PM by JustSumGuy.
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 22, 2018 06:30PM
It's just a T command on a line by itself to switch tools:

T0 ; Use tool 0
...
T1 ; Use tool 1

The firmware on the Duet will automatically run tool change macro files when you do a tool change.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 22, 2018 06:59PM
Ahh I see then, Thanx DC42

So just as a test if I understand it:
set the tool offset via G10 then just switch them up something like this:

G10 P1 X20 Y0 Z0 (tool #2 is 20mm from Tool #0 on X with xero offset from y axis or z axis)

G28 (home all axis)
T0 (set tool 0)
G1 X100 Y20 (move head on X axis 100mm and Y axis 20mm)
G1 E10 (push 10mm on extruder #0 as set by ??)
G1 Z10 (drop bed 10mm)
T1 (set tool #2)
G1 X100 (move head on X axis 100mm) -NOTE because the firmware knows we have switched to tool #1 it automatically adds the 20mm offset into the move???
g1 z-10 (return bed to orig hight)
G1 E10 (push 10mm on extruder #1 as set by ??)

How would the G1 E10 line know to use the second extruder (syringe in this case) motor?
NVM I just found M563 to setup the tool, specify extruder for tool here smiling smiley


Something like that?

P.S. hopefully my learning is helping the OP, I did not mean to hijack, sorry sad smiley

Edited 3 time(s). Last edit at 02/22/2018 07:35PM by JustSumGuy.
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 23, 2018 12:02PM
Quote
dc42
It's just a T command on a line by itself to switch tools:

T0 ; Use tool 0
...
T1 ; Use tool 1

The firmware on the Duet will automatically run tool change macro files when you do a tool change.

Hey dc42! Thanks for joining in.

So say we specify in the 3D model that each layer will be a different material, and the gcode gets made from this 3D model. This gcode has T commands in the gcode when it needs to switch material and switch to the other syringe/extruder? And then when it hits that T command, it will run some tool change macro we specify in a different folder?
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 23, 2018 12:05PM
Quote
JustSumGuy
Ahh I see then, Thanx DC42

So just as a test if I understand it:
set the tool offset via G10 then just switch them up something like this:

G10 P1 X20 Y0 Z0 (tool #2 is 20mm from Tool #0 on X with xero offset from y axis or z axis)

G28 (home all axis)
T0 (set tool 0)
G1 X100 Y20 (move head on X axis 100mm and Y axis 20mm)
G1 E10 (push 10mm on extruder #0 as set by ??)
G1 Z10 (drop bed 10mm)
T1 (set tool #2)
G1 X100 (move head on X axis 100mm) -NOTE because the firmware knows we have switched to tool #1 it automatically adds the 20mm offset into the move???
g1 z-10 (return bed to orig hight)
G1 E10 (push 10mm on extruder #1 as set by ??)

How would the G1 E10 line know to use the second extruder (syringe in this case) motor?
NVM I just found M563 to setup the tool, specify extruder for tool here smiling smiley


Something like that?

P.S. hopefully my learning is helping the OP, I did not mean to hijack, sorry sad smiley

This is such good information! Our team is still getting used to gcode commands but I believe this is what we are looking for. And you are not hijacking the thread, you are helping us out!

So this macro should be run when a T command is given, but I have to figure out how to initiate this T code/macro automatically from the imported gcode file.
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 23, 2018 01:03PM
If you use a slicer to generate a multi-material print file, then the GCode file it produces will have the T commands in it.

I wrote a blog entry in July 2014 about multi-material printing on a particular printer, including how the tool change files operate. Although the details have changed, the basic principles remain the same. See [miscsolutions.wordpress.com].

Edited 1 time(s). Last edit at 02/23/2018 01:05PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 24, 2018 02:22PM
Quote
dc42
If you use a slicer to generate a multi-material print file, then the GCode file it produces will have the T commands in it.

I wrote a blog entry in July 2014 about multi-material printing on a particular printer, including how the tool change files operate. Although the details have changed, the basic principles remain the same. See [miscsolutions.wordpress.com].

I appreciate your help, dc42! You've been much help for me.

I would like to clarify a few things on the link you sent:

1.) So when a material needs to change, in the gcode a T command is inserted at that point automatically by the slicer program. When the gcode reaches this T command, it stops in the gcode file and then runs tfree.g then tpre.g and then tpost.g in the /sys folder on the SD card. Is this correct so far?

2.) Assuming this to be correct, and I am on tool 1 wanting to switch to tool 2: You mention first tfree file for the outgoing nozzle/tool is run, and then the tpre for the new nozzle/tool is run, and then the tpost for the new nozzle/tool is run. Does this mean tfree1.g -> tpre2.g -> tpost2.g ?

3.) Assuming 2.) to be true, when I want to switch from tool 2 to tool 1: Does this mean tfree2.g -> tpre1.g -> tpost1.g ?

Edited 3 time(s). Last edit at 02/24/2018 02:24PM by blandified.
Re: Duet Ethernet - Dual Extruders - Macros/Switching Extruders
February 24, 2018 05:38PM
Quote
blandified
I would like to clarify a few things on the link you sent:

1.) So when a material needs to change, in the gcode a T command is inserted at that point automatically by the slicer program. When the gcode reaches this T command, it stops in the gcode file and then runs tfree.g then tpre.g and then tpost.g in the /sys folder on the SD card. Is this correct so far?

2.) Assuming this to be correct, and I am on tool 1 wanting to switch to tool 2: You mention first tfree file for the outgoing nozzle/tool is run, and then the tpre for the new nozzle/tool is run, and then the tpost for the new nozzle/tool is run. Does this mean tfree1.g -> tpre2.g -> tpost2.g ?

3.) Assuming 2.) to be true, when I want to switch from tool 2 to tool 1: Does this mean tfree2.g -> tpre1.g -> tpost1.g ?

That is all correct. The difference between tpre and tpost is that when tpre is run, no tool is selected; whereas tpost is run when the new tool has been selected and heating it to its active temperature has commenced. I've never needed to put anything in the tpre file; I put commands relating to the outgoing tool in tfree (e.g. move it out of the way) and commands relating to the new tool in tpost.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Sorry, only registered users may post in this forum.

Click here to login