How To: G-Code Startup Scripts for the Dual

The official subforum for discussion of the installation and use of the official M2 Dual Extruder upgrade.
User avatar
Jules
Posts: 3144
Joined: Wed Jan 21, 2015 1:36 am

How To: G-Code Startup Scripts for the Dual

Post by Jules » Tue Oct 20, 2015 10:37 pm

Oooookay....thanks go out to Jin and Tim for the handy-dandy directions on which way to go with this. :D

Couple of things to keep in mind:
Not for use in the M2 V4 Rev. E machines

I'm listing three scripts below, to be used in different circumstances. (Yep, everything is more complex with a dual! Chuckle!)

Tim and Jin, i did wind up adding a Y-offset jog and a secondary wipe into the code for the dual extruders...it was working fine without one as long as I was printing only PLA, but when I got around to finally testing it on PETG, the stickiness of that filament was keeping the right extruder from wiping the glob off completely. (Good call!)

These change the way the printhead moves off the bed, to prevent dragging the right nozzle across your binder clips accidentally. (also keeps that little bit of ooze from getting smashed into the nozzle at the X/Y home.)

I have an acceleration damper in there as well - it can be removed if you don't want to use one. (I personally prefer to not have everything rocketing around. ;) )

Single Extruder Left (Tool 0)
Use this one when you just want to prime the left nozzle.

M108 S255 ; turn on M2 extruder
M201 X1000 Y1000 ; lower default accelerations
T0
G28 X Y ; home X and Y axes
G1 Y50 F8000 ; move forward to avoid binder clips
G1 X215 ; move off platform
G28 Z ; home Z axis
G1 Z0.4 ; position nozzle
G92 E0 ; zero extruder
G1 E25 F225 ; purge nozzle
G92 E0 ; zero extruder
G1 X190 Z0.1 E1.0 F1200 ; slow wipe
G1 X180 Z0.25 ; lift


Single Extruder Right (Tool 1)
Use this one when you just want to prime the right nozzle.

M108 S255 ; turn on M2 extruder
M201 X1000 Y1000 ; lower default accelerations
T0
G28 X Y ; home X and Y axes
G1 Y50 F8000 ; move forward to avoid binder clips
G1 X215 ; move off platform
G28 Z ; home Z axis
G1 Z0.4 ; position nozzle
T1
G92 E0 ; zero extruder
G1 E25 F225 ; purge nozzle
G92 E0 ; zero extruder
G1 X190 Z0.1 E1.0 F1200 ; slow wipe
G1 X180 Z0.25 ; lift


Dual Extruders (Tool 0 & Tool 1)
Use this one when you want to prime both nozzles.

M108 S255 ; turn on M2 extruder
M201 X1000 Y1000 ; lower default accelerations
T0
G28 X Y ; home X and Y axes
G1 Y50 F8000 ; move forward to avoid binder clips
G1 X215 ; move off platform
G28 Z ; home Z axis
G1 Z0.4 ; position nozzle
T1
G92 E0 ; zero extruder
G1 E25 F225 ; purge nozzle
G92 E0 ; zero extruder
T0
G92 E0 ; zero extruder
G1 E25 F225 ; purge nozzle
G92 E0 ; zero extruder
G1 X190 Z0.1 E1.0 F1200 ; slow wipe
G1 Y60 ; y axis shift
T1
G1 X190 Z0.1 E1.0 F1200 ; slow wipe
G1 X180 Z0.25 ; lift
T0



And yeah, i use different ending scripts as well......those are next. :P
Last edited by Jules on Sat Mar 26, 2016 7:21 pm, edited 1 time in total.

User avatar
PcS
Posts: 667
Joined: Mon Mar 09, 2015 12:19 pm
Location: Michigan

Re: How To: G-Code Startup Scripts for the Dual

Post by PcS » Tue Oct 20, 2015 11:20 pm

Thanks Jules......I think....you are making me want to purchase the dual upgrade....;-)

mharter
Posts: 58
Joined: Tue Feb 10, 2015 11:51 am

Re: How To: G-Code Startup Scripts for the Dual

Post by mharter » Tue Oct 20, 2015 11:27 pm

Many thanks Jules!!
Last edited by mharter on Wed Oct 21, 2015 12:59 am, edited 1 time in total.

User avatar
Jules
Posts: 3144
Joined: Wed Jan 21, 2015 1:36 am

Re: How To: G-Code Startup Scripts for the Dual

Post by Jules » Tue Oct 20, 2015 11:36 pm

PcS wrote:Thanks Jules......I think....you are making me want to purchase the dual upgrade....;-)
Uh-huh, uh-huh, uh-huh. :P

It works a treat after you set up a few profiles. (And I'm sooooo glad not to have to run cleaner filament through anymore. It's like having two M2s in one!) :D
Many thanks Jules!!
My pleasure :D

mharter
Posts: 58
Joined: Tue Feb 10, 2015 11:51 am

Re: How To: G-Code Startup Scripts for the Dual

Post by mharter » Wed Oct 21, 2015 1:00 am

Finally got the chance to try these out...Damn! These are EXACTLY what I needed. Instant improvement. A super nice compliment to taking the time to properly calibrate everything, kinda like the icing on the cake. Many thanks again.

User avatar
Tim
Posts: 1205
Joined: Thu Apr 10, 2014 2:19 pm
Location: Poolesville, Maryland
Contact:

Re: How To: G-Code Startup Scripts for the Dual

Post by Tim » Wed Oct 21, 2015 1:00 am

Thanks, I never tried to work out a script for the right extruder only, nice to have you post one here. Just don't remind me that I was supposed to be the one doing this writeup. You do it so much better, anyway.

But---are you using the default tool change, without a special script? Aren't you getting the problem where the first extruder to be inactive doesn't retract at first?

User avatar
Jules
Posts: 3144
Joined: Wed Jan 21, 2015 1:36 am

Re: How To: G-Code Startup Scripts for the Dual

Post by Jules » Wed Oct 21, 2015 1:23 am

Tim wrote:But---are you using the default tool change, without a special script? Aren't you getting the problem where the first extruder to be inactive doesn't retract at first?
Yeah, I'm still using the default tool change, and it does leave a skimpy bit at first from the inactive nozzle. :cry: So far, I've gotten around it by always printing with a skirt or brim attached to the shield (actually i prefer the brim - at least 6 or more layers) with both nozzles selected for the brim.

But I noticed that if you are printing a shield, infill does not attach to it. (Build on it, whatever you want to call it - you have to be printing outlines or outer layers to get it to build on the shield.) So if you don't prime that inactive nozzle with a brim, you can get a skimpy spot in your print. As long as it's infill, it probably wouldn't matter much, but the non-wiping on the shield does cause little buildups to happen if you are using PETG as infill. For a long print, you'd have globs and maybe a crash situation.

So anyway, there is a LOT more to discover about this - get crackin'! :P

User avatar
Tim
Posts: 1205
Joined: Thu Apr 10, 2014 2:19 pm
Location: Poolesville, Maryland
Contact:

Re: How To: G-Code Startup Scripts for the Dual

Post by Tim » Wed Oct 21, 2015 3:24 am

Jules wrote:Yeah, I'm still using the default tool change, and it does leave a skimpy bit at first from the inactive nozzle.
My tool change script does solve the problem correctly, but you have to use it with a modified start script. The important thing is that you must print a skirt with the left extruder and not the right, because I don't think there's any other way to guarantee that the left extruder is the first one to print. That's the whole trick of the way I do it. I set it up so that the left extruder is guaranteed to be the first one to print, then I retract the right extruder at the end of the startup script. But since the S3D-generated g-code doesn't know what my scripts are doing and wants to do its own retractions and extrusions between tools in whatever random order it decides on, it's necessary to prevent S3D from doing that by setting its tool-change retraction length to zero, and adding a custom tool-change script.

User avatar
Jules
Posts: 3144
Joined: Wed Jan 21, 2015 1:36 am

Re: How To: G-Code Startup Scripts for the Dual

Post by Jules » Wed Oct 21, 2015 4:38 am

Yeah, i noticed that about not being sure which one prints first in the skirt. I'll try your script out as soon as i get my profiles finished up, to see if I like it better than the brim business. (That works perfectly fine, but you do have to remember to set a brim, or put it in your profiles as a default.)

i've noticed several other quirks about how s3d handles things that i need to work out first though. One deals with the filament diameter, which appears to be locked to the same value for both extruders when you set up a dual extruding profile. So if you change it for one extruder, it changes for the other. (Not cool, unless you are lucky enough to have the exact same diameter filament in both extruders, which doesn't happen often.)

So to use it with any accuracy, you have to leave the filament diameter set to the same value (1.75 mm) and adjust the extrusion multiplier for each filament, (because that can be adjusted individually), to compensate for any differences.

So for the last day or two, i've been running new calibration squares to recalculate extrusion multipliers for all of my PLA spools (about 20 of them), assuming a filament diameter of 1.75 mm, and the results have caused me to question everything that i've been telling people so far......with the exception of three filaments, every single one of them had a correct extrusion multiplier of 0.90 at a filament diameter of 1.75 mm! They were extruding correctly without being fiddled with. (Was not expecting that. :shock: )

In other words, the default values would give excellent printing results without having to adjust for filament diameter. The three exceptions were the wood filament, which needed a 0.95 multiplier and a complete reversal of the Z-Offset direction (but you remember how oozy that one is -it's a trick to dial in), and a couple of metallic and skin colored ones that had 0.87 and 0.89 multipliers at 1.75 mm filament diameter. Definitely close enough at 0.90 to get acceptable results - i was just being extremely picky by that point.

I'm wondering now if it isn't all about the gap. Get the Z-offset correct, and you can just get on down the road.

Well, anyway - I plan to test all my PETG as well (multiple spools there as well) to see what they do. (Can't move on to other things until i get this worked out in my mind.) :roll:

User avatar
Tim
Posts: 1205
Joined: Thu Apr 10, 2014 2:19 pm
Location: Poolesville, Maryland
Contact:

Re: How To: G-Code Startup Scripts for the Dual

Post by Tim » Wed Oct 21, 2015 1:53 pm

Jules wrote:In other words, the default values would give excellent printing results without having to adjust for filament diameter.
That's what I've always maintained. I think some people get a bit obsessive about dialing in these numbers. I don't think it's possible to tell the difference between a print with an extrusion multiplier at, say, 0.85 vs. 0.88, or with the filament diameter set to 1.72 vs. 1.75. It largely comes down to the human tendency to see patterns in randomness. There are far too many variables determining the quality of each print, including such difficult-to-control things like dust, humidity, ambient temperature, first layer adhesion, residue in the nozzle, etc. It's far too easy to get a bad print, adjust some number, try again, get a good print, and then believe that the change in that value was the definitive reason that the print was better.

Post Reply