Page 1 of 2
Trouble with startup script variables
Posted: Fri Jul 21, 2017 9:58 am
by billchurch
Trying to make a profile/process for my Prusa i3MK2 Multi-Material setup and I'm having trouble getting variables to take in the startup script.
Here's an example of what I have, note that "[new_tool]" is just me experimenting with trying to get the selected/starting tool variable to work. I also tried "[tool]" and "[old_tool]" without success. I do notice that "M104 S[extruder0_temperature] T1" is being interpreted correctly, but ideally I'd like "T1" to be a variable so I can start from my desired extruder.
Resulting G-code output:
Code: Select all
G90
M83
M106 S0
M115 U3.0.7 ; tell the printer latest firmware varsion available
M104 S205 T1
M140 S[bed0_temperature] T0
T[new_tool] ; set extruder
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for extrusion
G28 W ; home all without mesh bed level
G80 ; mesh bed leveling
G1 Y-3.0 F1000.0 ; go outside printing area
Any thoughts here? Is this even possible?
Re: Trouble with startup script variables
Posted: Fri Jul 21, 2017 1:29 pm
by brian442
The [old_tool] and [new_tool] variables are only for the tool change script. Look at the link below and pay attention to which section each variable is in:
viewtopic.php?f=8&t=1959
Re: Trouble with startup script variables
Posted: Fri Jul 21, 2017 6:26 pm
by billchurch
Ok. I'll play along. Let me ask the question a different way.
What variable is available to me which results in the current tool/extruded number? In that post you mentioned, there is no mention of an extruder variable. I have to think there would be one...
Re: Trouble with startup script variables
Posted: Sat Jul 22, 2017 6:01 am
by brian442
You're trying to use those in the starting script, correct? Nothing has even been printed at that point, so there is no current extruder yet. If you are manually trying to pick a toolhead to prime or something, just put T0 or T1 in the code directly.
Re: Trouble with startup script variables
Posted: Sat Jul 22, 2017 8:04 am
by billchurch
brian442 wrote:You're trying to use those in the starting script, correct? Nothing has even been printed at that point, so there is no current extruder yet. If you are manually trying to pick a toolhead to prime or something, just put T0 or T1 in the code directly.
I can put T0, T1, T2, T3 in the code, but if I've picked one of 4 extruders to start my print (meaning I need to prime the extruder) I want that automated instead of me manually inputting that extruder in the Script area.
I'm using a Prusa Multi Material upgrade which requires a prime routine before printing. Is there not a variable for the Primary extruder you specify in the Process to be input in a Starting Script? Maybe I'm missing something here but this is something I could do in Slic3r.
Is this not possible?
Re: Trouble with startup script variables
Posted: Sun Jul 23, 2017 7:16 am
by brian442
billchurch wrote:I can put T0, T1, T2, T3 in the code, but if I've picked one of 4 extruders to start my print (meaning I need to prime the extruder) I want that automated instead of me manually inputting that extruder in the Script area.
S3D will already automatically add the correct tool change command before printing, so you don't need to do that on your own. It's added automatically.
billchurch wrote:I'm using a Prusa Multi Material upgrade which requires a prime routine before printing. Is there not a variable for the Primary extruder you specify in the Process to be input in a Starting Script?
Nothing in the starting script that you posted does any priming. Those are just homing and setup commands, so you can do that with any tool selected. You could probably omit the T-command all together, or just use T0.
Re: Trouble with startup script variables
Posted: Sun Jul 23, 2017 7:46 am
by billchurch
Yes, I didn't post the entire script. Before S3D is to do the printing routine, I need to run my own prime routine. So, it does print ( I need to advance the filament a certain amount to bring it into the mixer ) and I need to select the extruder to do that.
What is the variable that represents the current or primary extruder. If there isn't one, just say there isn't one or there's not a way to do it.
I appreciate the other ideas but I need to print a prime routine before S3D does it's thing.
This was something that Slic3r did pretty easily, seems a little odd I can't get this going with S3D which is so much better in every other way...

Re: Trouble with startup script variables
Posted: Sun Jul 23, 2017 8:26 am
by brian442
Again, the starting script runs at the beginning of the print before anything has happened, so there is no "current" extruder. Those are literally the very first commands that are running. So if you want to prime a specific extruder, just write T0 or T1 as needed in the starting script.
There aren't any other placeholder variables for the extruder, so that's what you should use in the starting script
Re: Trouble with startup script variables
Posted: Mon Jul 24, 2017 7:05 am
by wirlybird
@billchurch,
Have you looked into this in the Prusa forums yet?
I haven't set my MM upgrade up yet so have not tried any of this but I read that there are issues at this point with S3D and the MM upgrade.
Re: Trouble with startup script variables
Posted: Tue Jul 25, 2017 2:12 pm
by jslick_007
Bill, any luck getting this sorted? I have an MMU and can't seem to get mine working with S3D either, so I've been stuck with Slic3r.
Simplify3d, it would be nice if there was an "official" profile for those of us that have the MMU. Just sayin...