billchurch
Posts: 6
Joined: Tue Oct 11, 2016 2:24 pm

Trouble with startup script variables

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.
Screenshot 2017-07-21 09.52.52.png
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?
Bill Church
Saint Petersburg, Fl USA
Original Prusa i3 Mk3 Kit
My Models/Creations http://www.thingiverse.com/illc0mm/
brian442
Posts: 1243
Joined: Mon Nov 28, 2016 5:35 am

Re: Trouble with startup script variables

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
billchurch
Posts: 6
Joined: Tue Oct 11, 2016 2:24 pm

Re: Trouble with startup script variables

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...
Bill Church
Saint Petersburg, Fl USA
Original Prusa i3 Mk3 Kit
My Models/Creations http://www.thingiverse.com/illc0mm/
brian442
Posts: 1243
Joined: Mon Nov 28, 2016 5:35 am

Re: Trouble with startup script variables

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.
billchurch
Posts: 6
Joined: Tue Oct 11, 2016 2:24 pm

Re: Trouble with startup script variables

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?
Bill Church
Saint Petersburg, Fl USA
Original Prusa i3 Mk3 Kit
My Models/Creations http://www.thingiverse.com/illc0mm/
brian442
Posts: 1243
Joined: Mon Nov 28, 2016 5:35 am

Re: Trouble with startup script variables

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.
billchurch
Posts: 6
Joined: Tue Oct 11, 2016 2:24 pm

Re: Trouble with startup script variables

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... :(
Bill Church
Saint Petersburg, Fl USA
Original Prusa i3 Mk3 Kit
My Models/Creations http://www.thingiverse.com/illc0mm/
brian442
Posts: 1243
Joined: Mon Nov 28, 2016 5:35 am

Re: Trouble with startup script variables

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
wirlybird
Posts: 1374
Joined: Sun Jul 17, 2016 1:32 pm

Re: Trouble with startup script variables

@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.
jslick_007
Posts: 3
Joined: Wed Jul 19, 2017 5:54 pm

Re: Trouble with startup script variables

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...

Return to “Troubleshooting and Bug Reports”