Jump to content

Material profiles: why are parameters not imported correctly? (printer definitions, material XMLs, etc. ahead)


neute
Go to solution Solved by nallath,

Recommended Posts

Posted · Material profiles: why are parameters not imported correctly? (printer definitions, material XMLs, etc. ahead)

Hi all,

 

so I've bitten the bullet and started to deep dive into printer and extruder definitions, material profiles, variants etc. because I'm using self-built printers or the printers don't have profiles provided for them in Cura (yet). So far so good, I learned JSON and XML (rant: I wish someone came up with a fool-proof GUI for this...) and have things going pretty okay.

 

Now I'm trying to set up material profiles for the filaments I use the most. Of course, in the filament .xml.fdm_material at first only basic properties are being stored, basically the ones that you can change in the "materials" settings pane in Cura (rant: why do I have to install a plugin to access more than 6 filament settings that are definitely related to the filament's properties?)

 

image.thumb.png.5cd9d719ef05297a8c095d75b2fb4624.png --> image.thumb.png.4acaa32495b02a223b74dd69608faaeb.png

 

Because my filaments are a bit more complex than this (e.g. I want to include settings like extra retraction amount, horizontal expansion, size compensation scaling etc.), I've then installed the "Materials Settings Plugin", created new filament profiles and altered them to see how the settings would reflect in the .xml.fdm_material file. For some reasons, the settings are not longer tagged as <setting> but <cura:setting> and wouldn't be included otherwise.

 

image.thumb.png.9fbe793c3471e00f2b0173be57dfdb80.png

--> image.thumb.png.97cd5f8e14fab355e0239760b606d7d5.png

 

Now comes the tricky part: say I created a new profile and modified it inside the material settings pane, having more settings selected by the plugin, counter-checking it in the XML file to see how the settings are reflected, then remove it from Cura and import it again, the settings change?? In particular, it is the "material_shrinkage_percentage" setting that I'm concerned with right now (rant: why are the variables named differently than their label in Cura??)

 

example; see the igus iglidur i180 XML file (attached, remove .zip), values are exagerrated for demonstration/debugging purposes 

    <cura:setting key="material_shrinkage_percentage_xy">100.2</cura:setting>
    <cura:setting key="material_shrinkage_percentage">102</cura:setting>

 

this it what shows in the material settings pane after a clean import (Material Settings Plugin activated):

image.thumb.png.8c3d225e3fba37cea575fc5e369754c9.png

 

...but when I check the setting in the parameters section, this is what I get and what I presume is actually used for slicing:

 

image.thumb.png.ff91abd19cd85be5a210a51be6a53397.png

 

...now I *felt* that it wasn't only this setting that is being altered upon importing, but it was the only setting that I could reproduce this behaviour with.

 

Could it be a bug or is it related to how the values are calculated by the printer definition? Because there seems to be some calculating going on, I didn't take the time to figure out what the formulas mean, but I have the feeling there's something fishy going on... (rant: there are some really stupid questionable standard settings in the fdmprinter definition that are also used for the Ultimaker profiles, such as - when 100 % infill (lines) is selected, bottom layers is turned up to 99999 so that effectively the part only consists of bottom layers - I might want to use different line widths, speeds etc for the infill, why would this be the default behaviour???)

 

nevertheless: here's the code for the scaling (from fdmprinter.def.json), what's going on there? might this be the reason?

                "material_shrinkage_percentage":
                {
                    "label": "Scaling Factor Shrinkage Compensation",
                    "description": "To compensate for the shrinkage of the material as it cools down, the model will be scaled with this factor.",
                    "unit": "%",
                    "type": "float",
                    "default_value": 100.0,
                    "enabled": true,
                    "minimum_value": "0.001",
                    "minimum_value_warning": "100",
                    "maximum_value_warning": "120",
                    "settable_per_mesh": false,
                    "settable_per_extruder": false,
                    "resolve": "sum(extruderValues(\"material_shrinkage_percentage\")) / len(extruderValues(\"material_shrinkage_percentage\"))",
                    "children":
                    {
                        "material_shrinkage_percentage_xy":
                        {
                            "label": "Horizontal Scaling Factor Shrinkage Compensation",
                            "description": "To compensate for the shrinkage of the material as it cools down, the model will be scaled with this factor in the XY-direction (horizontally).",
                            "unit": "%",
                            "type": "float",
                            "default_value": 100.0,
                            "enabled": true,
                            "minimum_value": "0.001",
                            "minimum_value_warning": "100",
                            "maximum_value_warning": "120",
                            "settable_per_mesh": false,
                            "settable_per_extruder": false,
                            "resolve": "sum(extruderValues(\"material_shrinkage_percentage_xy\")) / len(extruderValues(\"material_shrinkage_percentage_xy\"))",
                            "value": "material_shrinkage_percentage"
                        },
                        "material_shrinkage_percentage_z":
                        {
                            "label": "Vertical Scaling Factor Shrinkage Compensation",
                            "description": "To compensate for the shrinkage of the material as it cools down, the model will be scaled with this factor in the Z-direction (vertically).",
                            "unit": "%",
                            "type": "float",
                            "default_value": 100.0,
                            "enabled": true,
                            "minimum_value": "0.001",
                            "minimum_value_warning": "100",
                            "maximum_value_warning": "120",
                            "settable_per_mesh": false,
                            "settable_per_extruder": false,
                            "resolve": "sum(extruderValues(\"material_shrinkage_percentage_z\")) / len(extruderValues(\"material_shrinkage_percentage_z\"))",
                            "value": "material_shrinkage_percentage"
                        }

 

Final question; am I doing this right? Or do the more advanced settings like horizontal expansion etc. have to be included in a quality config file and would this solve my problems? (rant: yet another preset file, yet another scripting language?? WTF)

 

reference 3MF project enclosed, remove .zip

thanks for taking some time, 

best, Niklas

igus_igliduri180_1-75.xml.fdm_material.zip demonstration.3mf.zip

  • Link to post
    Share on other sites

    Posted · Material profiles: why are parameters not imported correctly? (printer definitions, material XMLs, etc. ahead)
    On 1/5/2023 at 10:57 AM, neute said:

     (rant: why are the variables named differently than their label in Cura??)


    Because the things we store are keys and the things you see are labels. We can't store the labels, as they can also be translated.

    For the rest, you might want to check https://github.com/Ultimaker/Cura/wiki/Profiles-&-Settings

     

    What is probably going on is that the igildur quality profiles set the shrinkage percentage. Alternatively it could also be that they are influenced by what the other extruders are doing. Some settings need a single value for all extruders, even though materials can influence it (material shrinkage is one of them).

     

    Quote

    (rant: there are some really stupid questionable standard settings in the fdmprinter definition that are also used for the Ultimaker profiles, such as - when 100 % infill (lines) is selected, bottom layers is turned up to 99999 so that effectively the part only consists of bottom layers - I might want to use different line widths, speeds etc for the infill, why would this be the default behaviour???)

    This is far from stupid, but a legacy thing. In the Ultimaker profiles, these are also no longer used. The reason for this being the default reason is that it was orders of magnitude faster to slice a few years ago. Generally speaking, we are quite conservative when it comes to changing settings for pritners that we don't have (as we are unable to test them).

  • Link to post
    Share on other sites

    Posted · Material profiles: why are parameters not imported correctly? (printer definitions, material XMLs, etc. ahead)

    Hi Nallath,

     

    thanks for your reply. First, sorry for yet another post of a user venting frustration about things they don't understand, I see those quite often around here.

     

    On 1/6/2023 at 4:42 PM, nallath said:

    What is probably going on is that the igildur quality profiles set the shrinkage percentage. Alternatively it could also be that they are influenced by what the other extruders are doing. Some settings need a single value for all extruders, even though materials can influence it (material shrinkage is one of them).

     

    I think the latter is the issue here. There are no qualities for these specific iglidur materials, since I've created them from scratch with new GUIDs and everything. I've played around a little with loading different materials between the 4 extruders and disabling single extruders and I do now understand more or less how it behaves, as well as understanding the formula that calculates the average shrinkage between the active extruders. I just need to remember that I have to check on this setting if I'm using more than one material or have more than one extruder active at a time (which the whole intention of creating material and printer profiles in the first place was to not have to go through the whole settings pane before every print job)

     

    How do I know if a setting is shared between extruders, is it just the "settable per extruder" parameter?

     

    Re my question "am I doing this right" - where should the setting "material shrinkage" be included for a material; it seems that it is not intended to be in the material XML. Should it be in a quality profile even if it's theoretically the same over all hypothetical qualities? Intuitively I'd want it to set only once/in a single place in this case.

     

    thanks again, have a nice week

     

    Best, Niklas

  • Link to post
    Share on other sites

    • Solution
    Posted (edited) · Material profiles: why are parameters not imported correctly? (printer definitions, material XMLs, etc. ahead)

    The material shrinkage should be in the XML; It's not something that changes depending on the quality. I couldn't think of a situation why you would want that.

    If a setting isn't "settable per extruder" it's indeed a global setting (and must have a single value, regardless of how many extruders there are). Often these settings also have a "resolve" function. A good example of this is the bed temperature. Obviously, there can only be a single bed temperature, but it is something that a material has an opinion about. So if you select two materials (say, ABS and PLA), we need to "resolve" the suggestions given by both materials into a single one.

    Edited by nallath
    • Like 1
    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • Introducing Universal Cura Projects in the UltiMaker Cura 5.7 beta
        Strap in for the first Cura release of 2024! This 5.7 beta release brings new material profiles as well as cloud printing for Method series printers, and introduces a powerful new way of sharing print settings using printer-agnostic project files! Also, if you want to download the cute dinosaur card holder featured below, it was specially designed for this release and can be found on Thingiverse! 
          • Like
        • 10 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...