Jump to content
UltiMaker Community of 3D Printing Experts

Feature request: Custom G-code in profile


Marno

Recommended Posts

Posted · Feature request: Custom G-code in profile

Hi,

 

I have a suggestion for a feature in Cura: being able to add custom G-code in a printing profile that gets inserted between the start G-code set in machine settings, and the printing G-code.

For example for Malin users; a space where you can add G-code for custom Linear Advance values for a specific material, instead of having to change it every time in the machine settings window of Cura, or having to update it via the terminal every time before starting a print.

 

Looking forward to feedback on my suggestion.

 

Marno

  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile
    18 minutes ago, ahoeben said:

    Note that there’s a plugin to get you a setting to solve your linear advance usecase.

    Thank you very much for your reply!  I will give it a try.

  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile

    Commenting here to help the next guy:

     

    Plugins are under 'Marketplace' and you are looking for 'Linear Advance Settings'

    Then you can set {material_linear_advance_factor} from the right side panel in Cura.

    To use it you will have to add a line like 'M900 K{material_linear_advance_factor}' to your start g-code.

    I follow that line with 'M900 W{line_width} H{layer_height} D{material_diameter}' like it says in the readme:

    https://github.com/fieldofview/LinearAdvanceSettingPlugin
     

    I don't think this works with adaptive layer heights, not perfectly anyway.  I think we would have to include 'M900 W{line_width} H{layer_height} D{material_diameter}' at each layer, or each layer that is different from the last. If we wanted to adjust the Linear advance perfectly for different layers in prints sliced with adaptive layers enabled. If someone wants to test this, it could be hacked tother with a search/replace in the g-code post processor.

     

  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile
    10 hours ago, drewoprea said:

    Commenting here to help the next guy:

     

    Plugins are under 'Marketplace' and you are looking for 'Linear Advance Settings'

    Then you can set {material_linear_advance_factor} from the right side panel in Cura.

    To use it you will have to add a line like 'M900 K{material_linear_advance_factor}' to your start g-code.

    I follow that line with 'M900 W{line_width} H{layer_height} D{material_diameter}' like it says in the readme:

    https://github.com/fieldofview/LinearAdvanceSettingPlugin
     

    I don't think this works with adaptive layer heights, not perfectly anyway.  I think we would have to include 'M900 W{line_width} H{layer_height} D{material_diameter}' at each layer, or each layer that is different from the last. If we wanted to adjust the Linear advance perfectly for different layers in prints sliced with adaptive layers enabled. If someone wants to test this, it could be hacked tother with a search/replace in the g-code post processor.

     

    This will be handy!

  • Link to post
    Share on other sites

    Posted (edited) · Feature request: Custom G-code in profile
    11 hours ago, drewoprea said:

    To use it you will have to add a line like 'M900 K{material_linear_advance_factor}' to your start g-code.

     

    In the current version of the plugin, this line is automatically added if it is not in the start g-code.

     

    I don't know if the second line is required or not. If it is, it does seem that this would be an issue with adaptive layer height. I admit I have never used to plugin beyond testing (or adaptive layer height for that matter).

     

    I think the plugin could also be improved for multiple extrusion; currently there is one "global" linear advance constant, but since its value is material dependent I would say that it should be possible to set this per extruder, and the M900 lines should actually (also) be in the extruder start gcode.

     

    PS: in case you had not put 1 and 1 together, I'm the author of the Linear Advance Setting plugin.

    Edited by ahoeben
  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile
    On 12/12/2018 at 8:52 AM, ahoeben said:

     

    In the current version of the plugin, this line is automatically added if it is not in the start g-code.

     

    I don't know if the second line is required or not. If it is, it does seem that this would be an issue with adaptive layer height. I admit I have never used to plugin beyond testing (or adaptive layer height for that matter).

     

    I think the plugin could also be improved for multiple extrusion; currently there is one "global" linear advance constant, but since its value is material dependent I would say that it should be possible to set this per extruder, and the M900 lines should actually (also) be in the extruder start gcode.

     

    PS: in case you had not put 1 and 1 together, I'm the author of the Linear Advance Setting plugin.

    Mr Plugin Author, thank you very much for your feedback!

    In addition to the K factor, would it be possible to add a line to manually input the ratio (M900 R#), or to use the extrusion width, layer height, and filament diameter from the Cura inputs to add the "M900 K0.7 W0.4 H0.1 D1.75" GCode to set the WH/D [W * H / ((D / 2) ^ 2 * PI)] ratio?  Or just to input the values manually?

  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile

    I don't quite get the request.

     

    You can use this in your start gcode:

    M900 K{material_linear_advance_factor} W{line_width} H{layer_height} D{material_diameter}

    Type the actual text, with the curly brackets, and the values will be filled in.

  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile
    On 12/13/2018 at 9:26 AM, ahoeben said:

    [...] You can use this in your start gcode:

    
    M900 K{material_linear_advance_factor} W{line_width} H{layer_height} D{material_diameter}

     

     

    Where does one set {material_linear_advance_factor}? I don't see it in the material profiles.

  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile
    1 minute ago, bobstro said:

     

    Where does one set {material_linear_advance_factor}? I don't see it in the material profiles. 

     

    Settings Visibility > Materials > Linear Advance Factor must be enabled, then there's a box in the Profile sidebar for it (under the Materials heading)


    I thought I typed that out in my comment above, apparently I skipped it.

  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile
    32 minutes ago, drewoprea said:

     

    Settings Visibility > Materials > Linear Advance Factor must be enabled, then there's a box in the Profile sidebar for it (under the Materials heading)


    I thought I typed that out in my comment above, apparently I skipped it.

    Ah, thanks. I had enabled all settings in my preferences prior to installing the plugin, but apparently needed to go back in and re-select the option to show all settings. I'm not sure if this is documented anywhere, but it's worth noting.

     

    Thanks for a great feature.

     

    One of the really interesting features of IdeaMaker is to allow individual material profiles to selectively over-ride system-wide settings. This is great for allowing things like speeds & accerations to be adjusted for filaments using otherwise-similar profiles. 

  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile

    I second the request for a different use case..

    I have enabled UBL in custom marlin.. I have 2 glass beds and may add pei as well. I can create a separate mesh for each of these saved in EEPROM and select the one according to the print surface I use, being able to send those commands from the profile would be a great way to do that, it would be significantly easier to change a string field in the profile changing the 0 to 1 or 2, than editing the start-code or selecting mesh from the lcd each time..

  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile

    You can do this with machine settings.  Create a second machine with the different gcodes.  You have to edit either python or more likely json files.  There are quite a few people on here who have created their own machine settings.  And most printer sellers have created these machine profiles as well.  It's really not hard.

     

    In addition you can make the mesh for your different beds look different so you have a visual reminder of which bed type you are slicing for.

     

    @GregValiant - has done some customization - maybe he can mention where to find your file.  What printer are you using?

  • Link to post
    Share on other sites

    Posted · Feature request: Custom G-code in profile

    Hello

    You can add additional instances of your printer in Cura.  If the differences in the ABL command can be handled in the StartUp G-Code.  "My Printer - PEI" would include the leveling mesh for that build surface in the Startup Gcode.  "My Printer -glass 1" would include the leveling mesh for that build surface, etc.  Just pick the correct printer instance when you start a project.

    There are other workarounds but I've found that method to be the easiest to implement.  Each printer instance could have a different sized build plate if that was necessary.

     

  • 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.3 stable released
        In this stable release, Cura 5.3 achieves yet another huge leap forward in 3D printing thanks to material interlocking! As well as introducing an expanded recommended print settings menu and lots of print quality improvements. Not to mention, a whole bunch of new printer profiles for non-UltiMaker printers!
          • Thanks
          • Like
        • 21 replies
      • Here it is. The new UltiMaker S7
        The UltiMaker S7 is built on the success of the UltiMaker S5 and its design decisions were heavily based on feedback from customers.
         
         
        So what’s new?
        The obvious change is the S7’s height. It now includes an integrated Air Manager. This filters the exhaust air of every print and also improves build temperature stability. To further enclose the build chamber the S7 only has one magnetically latched door.
         
        The build stack has also been completely redesigned. A PEI-coated flexible steel build plate makes a big difference to productivity. Not only do you not need tools to pop a printed part off. But we also don’t recommend using or adhesion structures for UltiMaker materials (except PC, because...it’s PC). Along with that, 4 pins and 25 magnets make it easy to replace the flex plate perfectly – even with one hand.
         
        The re-engineered print head has an inductive sensor which reduces noise when probing the build plate. This effectively makes it much harder to not achieve a perfect first layer, improving overall print success. We also reversed the front fan direction (fewer plastic hairs, less maintenance), made the print core door magnets stronger, and add a sensor that helps avoid flooding.
         

         
        The UltiMaker S7 also includes quality of life improvements:
        Reliable bed tilt compensation (no more thumbscrews) 2.4 and 5 GHz Wi-Fi A 1080p camera (mounted higher for a better view) Compatibility with 280+ Marketplace materials Compatibility with S5 project files (no reslicing needed) And a whole lot more  
        Curious to see the S7 in action?
        We’re hosting a free tech demo on February 7.
        It will be live and you can ask any questions to our CTO, Miguel Calvo.
        Register here for the Webinar
          • Like
        • 18 replies
      • UltiMaker Cura Alpha 🎄 Tree Support Spotlight 🎄
        Are you a fan of tree support, but dislike the removal process and the amount of filament it uses? Then we would like to invite you to try this special release of UltiMaker Cura. Brought to you by our special community contributor @thomasrahm
         
        We generated a special version of Cura 5.2 called 5.3.0 Alpha + Xmas. The only changes we introduced compared to UltiMaker Cura 5.2.1 are those which are needed for the new supports. So keep in mind, this is not a sneak peek for Cura 5.3 (there are some really cool new features coming up) but a spotlight release highlighting this new version of tree supports.  
          • Like
        • 22 replies
    ×
    ×
    • Create New...