Page 1 of 1

Tool Change script for S3D

Posted: Sun Jul 19, 2015 10:00 pm
by dsharp02
I've designed a dual extruder that has only a single hot-end (inspired by the palette). This eliminates the problem of getting the offset set correctly. However since both filaments go into the same hot end, the tool change g-code needs to retract the old filament to make room for the new filament. The problem I'm having is that on the first layer, on the first tool change, the seconday extruder is not getting primed into place.

Each extruder is retracted 45 mm when not active. On the first layer, initially the primary extruder is active, so the secondary is retracted to -45mm. When the tool change happens, instead of issuing a G1 E0, S3D is zeroing out the secondary extruder with a G92 E0. Consequently, the secondary extruder, even after printing the priming isn't primed. Furthermore if the secondary extruder isn't used enough, the subsequent tool change retraction will back the filament entirely out of the extruder.

I'm looking at the tool change script, but I can't seem to figure out how to make one that does what I need. I'd appreciate any helpful suggestions.

Thanks,
Dave

Re: Tool Change script for S3D

Posted: Mon Jul 20, 2015 12:47 am
by Tim
I posted this somewhere else on the forum. I also sent some emails to S3D support about it. S3D does not do the right thing.

In a nutshell: It is necessary to fix the gcode start script to force the right extruder to retract before printing, fix the gcode tool change script so that it overrides S3D's default tool change, and then ensure that the left extruder is always the first one to become active and start printing.

The following needs to be done for the gcode start script:

Code: Select all

M108 S255 ; Turn on M2 fans
T0 ; Switch to left extruder offsets for homing
G28 ; Home all axes
G1 X0 Y50 Z0.3 F9600 ; Move forward to avoid binder clips
G1 X208 Z10 F3600 ; Move off platform
G1 Z0.4 ; Position nozzle above buildplate
G92 E0 ; Zero extruder
G1 E25 F225 ; Purge left extruder
G92 E0 ; Zero extruder
T1 ; Set right extruder
G1 E15 F225 ; Purge right extruder
G92 E0 ; Zero extruder
G1 X160 Z0.1 E1.0 F1200 ; Slow wipe
G1 X140 Z0.25 ; Lift
G90 E0 ; Zero extruder
G1 F1200 E-10 ; Initial retraction
G90 E0 ; Zero extruder
Most of the top part is the same as the default script, although the X position for "move off platform" has been corrected. The main thing is that at the end of it, it switches to the right extruder and retracts it. That will only work correctly if the first extruder to be active is the left extruder (see below).

And the following needs to be done for the tool change gcode script (must override the default behavior of S3D, which otherwise doesn't know that the right extruder has already been retracted):

Code: Select all

T[old_tool]
G92 E0
G1 F1200 E-10
G92 E0
T[new_tool]
G92 E0
G1 F1200 E10
G92 E0
I found that the tool change script does not override S3D's tool change behavior, just runs in addition. To stop S3D from doing tool changes, you need to go to the "Advanced" tab and set the "Tool change retraction distance" to zero.

Finally, to make this work, it is necessary to make sure that you check "Use skirt/brim", and that the skirt/brim extruder is set to the left extruder (by the way, I have set the left extruder to be T0, and the right extruder to be T1, which is opposite from the S3D defaults). Only then will everything work correctly.

I think I covered everything I did to get the dual extruder retraction cycles working correctly.

The S3D support team seemed attentive to my suggestions, so hopefully the errors with the dual extruder retraction will be fixed in the next bugfix release.

Re: Tool Change script for S3D

Posted: Wed Oct 18, 2017 4:29 pm
by italocjs
Thank you sooooooooooooooooo much.
I've spend almost 20h (one full night plus half a day), Using the skirt solved my problem, For some reason the S3D does not use the tool change script when i tell it to change the tool on the starting script, I managed to make it work using the skirt option (altought i didnt managed to make the purge yet)

My code:
Start script
M190 S[bed0_temperature]
M109 S160
G28
G29
G1 Z0
M109 S[extruder0_temperature]


tool change script
G91; Relative Coordinates
G1 Z+1 F300; Lift Z for Tool Change
G90; Absolute Coordinates
T[old_tool]; Select Old Tool
G92 E0; Zero Extruder
G91; Relative Coordinates
G1 E-5 F10000; Fast Retract 5mm
G1 E2 F10000; Fast Reinsert 2mm
G4 P3000; Pause 3secs
G1 E-100 F1000; Fast long retract 100
G1 E-100 F1000; Fast long retract 100
G1 E-100 F1000; Fast long retract 100
G1 E-97 F1000; Fast long retract
G90; Absolute Coordinates
G92 E0; Zero Extruder
T[new_tool]; Select New tool
G92 E0; Zero Extruder
G91; Relative Coordinates
G1 E100 F2000; Fast long retract 100
G1 E100 F2000; Fast long retract 100
G1 E100 F2000; Fast long retract 100
G1 E95 F2000; Fast insert 105mm
G1 E5 F300; 5mm/s Feed 5mm
G92 E0; Zero Extruder
G1 Z-1 F3000; Return Z to resume printing
G90; Absolute Coordinates

End script
T1
M104 S0 ; turn off extruder temperature
T0
M104 S0 ; turn off extruder temperature
M140 S0 ; turn off bed
G91 ; relative mode
G1 Z10 ; lift 10mm
G90 ; absolute mode

My setup use a single nozzle for two extruders, and i plan to use 4 in a near future

Re: Tool Change script for S3D

Posted: Sun Oct 22, 2017 3:37 am
by Tim
Can you share a picture of your single-nozzle dual extruder? It sounds interesting. How well does it work in practice?

Re: Tool Change script for S3D

Posted: Wed Sep 19, 2018 1:56 am
by dsharp02
Sorry for the delayed response.

Image
https://photos.app.goo.gl/RjNPdJzA8rp9iK9w7

It works well enough. Slicers didn't have the priming tower feature at the time I was making this, so the transitions are not as good as they should be. My experiment with soluable support fell apart completely because the transitions between the object and support were not very clean.

Dave