Jump to content

Help understanding layer_height config file options


jlgtx

Recommended Posts

Posted (edited) · Help understanding layer_height config file options

I've created a custom printer config, and I need to tweak some of the settings. First thing is to constrain the available layer heights to those that are optimal for this printer. Looking at the Ultimaker 3 definition file (and chasing the "inherits") as an example, I see the layer_height configuration options (mostly in the fdmprinter.def.json file), but I don't see how to constrain them to specific numbers. For example, let's say I want to only allow layer_height in increments of 0.04. Is there a calculation for that, or do I just define a bunch of presets, or is there a "layer_height_increment" setting that I'm not seeing?

Edited by Guest
  • Link to post
    Share on other sites

    Posted · Help understanding layer_height config file options

    I haven't looked at this very carefully so I'm not knowledgeable but my impression was that the json file can contain javascript so you could use some javascript math functions such as "int()". For example:

    Math.floor(x/0.04 + 0.5)*0.04

    will convert any value x to the nearest multiple of .04.

    You can probably put that anywhere you can put any other variable. I could be wrong but I'm pretty sure you can do stuff like this somehow.

    This will *not* restrict the value but at least it will only suggest values that meet your requirements.

    Having said that, the whole "it's best to use multiples of a single microstep" argument is probably wrong. It might be true of whole steps, but I doubt it's true of microsteps unless you also use the "tl-smoother" or have really good stepper drivers.

  • Link to post
    Share on other sites

    Posted · Help understanding layer_height config file options

    I assume that the stepper motors for this printer use 0.04mm increments, or something. The instructions say, "For best results, set your layer heights in 40 micron (0.040 mm) increments. For example, 0.16mm, 0.20mm, 0.24mm etc." So I'm just trying to make the Cura profile match that.

    I hate to experiment with profiles, because my experience has been that a badly-written profile is a good way to completely screw up my Cura settings and have to start over. But, until the printer mfr decides to produce updated Cura profiles for their hardware, I guess that's where I am.

  • Link to post
    Share on other sites

    Posted (edited) · Help understanding layer_height config file options

    my impression was that the json file can contain javascript so you could use some javascript math functions such as "int()".  For example:

    You got the wrong impression then.

    The listed layer heights for a specific printer actually depend on the quality profiles available for that printer/material combination. See the quality profiles per printer in the resources/quality folder.

    There is nothing constraining the "steps" of the value for layer height entered in the "custom" mode sidebar.

    General tip for @jlgtx: the UM3 definitions and profiles are not the easiest to understand/learn from, because they use the whole set of tricks that can be used with definitions/profiles (ie: quality profiles per material, print core type and layer height, as well as some trickery to prevent some incompatible combinations for multiextrusion). Start with eg the Peopoly Moai quality profiles if you want to have a less steep learning curve (though that printer has other peculiarities, being an SLA printer).

    Edited by Guest
  • Link to post
    Share on other sites

    Posted · Help understanding layer_height config file options

    my impression was that the json file can contain javascript so you could use some javascript math functions such as "int()".  For example:

    You got the wrong impression then.

    Well then how come when I set the shell width to various values there is clearly some kind of formula for auto calculating the wall line count? Or is wall line count not part of profiles? It looks like at a minimum one can do division (divide shell width by line width to get wall line count perhaps) in a profile. I thought I saw other examples of math happening but maybe none of those are part of the profile and they are all hard coded by cura?

  • Link to post
    Share on other sites

    Posted · Help understanding layer_height config file options

    @ahoeben - I just checked and there are these files - are these not printer configuration files? They sure seem to have javascript to control the parameters. This is from fdmprinter.def.json.

    Now I'm even more sure than before that you can do this kind of thing that the poster asked for. Sort of.

                            "wall_line_count":
                           {
                               "label": "Wall Line Count",
                               "description": "The number of walls. When calculated by the wall thickness, this value is rounded to a whole number.",
                               "default_value": 2,
                               "minimum_value": "0",
                               "minimum_value_warning": "1",
                               "maximum_value_warning": "10",
                               "type": "int",
                               "value": "1 if magic_spiralize else max(1, round((wall_thickness - wall_line_width_0) / wall_line_width_x) + 1) if wall_thickness != 0 else 0",
                               "limit_to_extruder": "wall_extruder_nr",
                               "settable_per_mesh": true
                           }
    

  • Link to post
    Share on other sites

    Posted · Help understanding layer_height config file options

    Ok, I was not clear enough, and should have quoted a different part of your reply.

    You can use javascript to set a value based on the value of other setting(s). You can use javascript (or an absolute value) to set a minimum and/or maximum value for a setting. You cannot use javascript to change the value of a field you just entered data into, so it is not possible to use javascript to round a value to a certain precision using code similar to the example you posted.

    You can not calculate the value of the layer height setting from the value of the layer height setting.

    What you can do with a carefully crafted printer definition is hide the actual layer height setting from the user, and introduce a different setting that maskerades as the layer height. Then the value of the actual layer height could be calculated from the mock-layer-height setting value.

  • Link to post
    Share on other sites

    Posted · Help understanding layer_height config file options

    It's python actually. But for the rest, Aldo is right (as usual)

  • Link to post
    Share on other sites

    Posted · Help understanding layer_height config file options

    You cannot use javascript to change the value of a field you just entered data into, so it is not possible to use javascript to round a value to a certain precision using code similar to the example you posted.

    I didn't think you could. I was just saying you can at least have it default to favorable values for that printer.

    What you can do with a carefully crafted printer definition is hide the actual layer height setting from the user, and introduce a different setting that masquerades as the layer height. Then the value of the actual layer height could be calculated from the mock-layer-height setting value.

    That's cool!

  • 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

      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 18 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...