Jump to content
Ultimaker Community of 3D Printing Experts
Marno

Feature request: Custom G-code in profile

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. 

Share this post


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

    • How to 3D print with reinforced engineering materials
      Ultimaker is hosting a webinar where we explain how you can achieve and maintain a high print success rate using these new reinforced engineering materials. Learn from Ultimaker's Product Manager of Materials and top chemical engineer Bart van As how you can take your 3D printing to that next level.
      • 0 replies
    • "Back To The Future" using Generative Design & Investment Casting
      Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
        • Like
      • 12 replies
×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!