DaveA
Posts: 11
Joined: Tue Mar 22, 2016 5:26 pm

Different start script on material selection

Is it possible to have a unique start script for each material? I can't find a way to make this work so this may be a feature request or a bug.
I'm using the latest Marlin firmware with the unified bed leveling implemented. This scheme can have multiple mesh maps of the bed surface.
Each map is created under different temperature settings for PLA, ABS, etc. It would be helpful to automatically select the mesh that corresponds to the type of material in use. I need to output a G29 L0 for PLA and G29 L1 for ABS.

Thanks
jerryjs8
Posts: 6
Joined: Mon Jun 26, 2017 3:19 pm

Re: Different start script on material selection

Yeah, that'd definiately also be useful for loading different PID values based on the printing material. But as far as I know you'll just have to save a different printer profile for each new script you want to use and name them after the material.
brian442
Posts: 1243
Joined: Mon Nov 28, 2016 5:35 am

Re: Different start script on material selection

Yes, just go to File > Export FFF Profile, choose the one you want to edit, then open that file in a text editor. Add the <startingScript> tag into each <autoConfigureMaterial> section at the bottom, then save and reimport into the software. Voila! Your starting script will now be different for each material.

There are lots of threads on the forum explaining this more if you're interested. You only have to edit it this way once. After that you can use the S3D GUI to change the starting scripts for each material and they will automatically be saved correctly.
DaveA
Posts: 11
Joined: Tue Mar 22, 2016 5:26 pm

Re: Different start script on material selection

I just got back to working on this and found I had version 4.0 waiting. I did eventually get this to work but not in the way I expected.

To get a different start script for each material type I needed to add the following tag for each autoConfigureMaterial section
<startingGcode>M280 P0 S160,G28,G29 A ;activate UBL,G29 L0 ;load mesh #0 for PLA</startingGcode>
I have similar strings for ABS and PETG in the autoConfigureMaterial sections.

With this setup I can see the code change in the UI Scripts/Starting Script tab as I change material and the right gcode is sent to the printer. But how do you know what field to change/add to the profile?

But it brings up another question. Is there a published "map" between the XML tags in the profile file and the items in the UI?

Return to “General Discussion and Tips”