Cura: Allow start/end G-code changes in quality profiles

Created on 18 May 2018  路  13Comments  路  Source: Ultimaker/Cura

Use cases:

For filament g-code, one could control various firmware features that differ on a per-material basis, such as linear advance or firmware retraction (which still depends on an external plugin that doesn't work in 3.3.1 for Linux :frowning_face: ).

For print profiles (e.g. speed/quality/etc), to be able to override the above when needed (for example, on my bot, I have to set linear advance to 0 when printing at high speeds).

Better to have the slicer insert the appropriate commands than to have to remember what to send when.

Cura Settings Won't FiDo New Feature

Most helpful comment

@Ghostkeeper, there's a nifty plugin here: https://github.com/fieldOfView/LinearAdvanceSettingPlugin
It adds a couple of settings to the sidebar that can be used in start/end gcode snippets.

All 13 comments

I don't follow... It's already possible to change settings based on a material or quality profile, this includes speed and retractions. What settings/commands would need to be added exactly to meet your demands? Maybe describe with some G-code snippets?

Well, on my bot for example, I would want to use M900 K0.08 to set an appropriate Marlin linear advance value for Atomic white PLA, when printing at moderate speeds, but say M900 K0.35 or thereabouts for PETG. I imagine TPU or other flexibles would need even higher values (though I don't use them, yet). I have the K0.08 setting in my printer start G-code already, just to at least compensate for the nature of my extruder and hotend (but fixed at that value, it can't compensate for differences in filaments).

I could see others needing to issue M851 Znnnn commands per-filament as well, if they have beds or hotends that vary in Z position in response to printing temperature (e.g. heat expansion or if the bed just warps a little when hot).

When printing with the above-mentioned white PLA, I have to remember to issue M900 K0 manually after the print starts (I use Pronterface as my host), if it's a high-speed print. It would be nice if I could store that command in my high-speed-PLA profile.

I would suggest per-filament g-code be written into the g-code file after the printer start g-code, then print profile g-code after that, then of course the g-code for actually printing the model.

So it boils down to having a start/end g-code that's specific for the profile?

Yep, that's about the size of it.

Well, specific for the material (one for the overall print quality profile would be a plus).

Alright, thanks for the clarifications.

This is already possible by editing the config files, there is just no way to edit gcode snippets in the sidebar. An important reason why this is not currently possible in the frontend is that there is no multiline string setting widget for the sidebar.

If you change the start gcode in the Machine Settings, it will be stored in a .inst.cfg file in the definition_changes folder inside the configuration folder. If you want to move this start gcode to a quality profile, find its file inside the quality_changes folder, and move the machine_start_gcode lines from the definition_changes .inst.cfg to the quality_changes file.

I would like this feature too. Right now I have a section for each filament I use in the machine start g-code and uncomment the one I'm currently using. I set the K factor for linear advance and the extruder steps/mm (how deep is the filament being bitten by the extruder gear).

@fieldOfView That was the single one most useful answer one could give here. Thumbs up.

We've discussed it and decided not to do do this. However, @VanessaE you can always add multiple printers with each of them with their own start/end g-code.

The whole point of material start/end g-code is to be able to send material-specific commands without having to remember what goes with what. That's the computer's job.

Most people I know who have a 3d printer have more than one - typically with different styles and capabilities (think high-end delta vs. CoreXY vs. a cheap Prusa i3 MK1 derivative). How's that going to work out with 2-3 printers and a dozen materials?

Your 2-3 printers will have different settings for linear advance anyway.

The idea is that you add a different printer for each style/capability and modify the start or end g-code if the actual procedure is different. You need to make different movements or do things in a different order. That is really only applicable to the printer, not to materials.

Keep in mind that you can use settings in your start or end g-code, too! If you need the printing temperature in the start or end g-code, for instance, you can insert {material_print_temperature} in the g-code, like this:

M109 S{material_print_temperature}

Stuff like what you're saying previously, like setting Linear Advance via M900 should really be a normal Cura setting, but Cura doesn't support that right now. You can still set it depending on the material but it requires a trick: Just use a setting that is not used by your print. You can include M900 {raft_base_thickness} in your start g-code to set the Linear Advance to be equal to the Raft Base Thickness. If you're not using rafts then this works all right, albeit a bit hacky.

It sounds like your real problem is that Cura has no setting for Linear Advance. Note that Cura does have an option for Z offset per material (multiple in fact, if you count Initial Layer Z Overlap too).

@Ghostkeeper, there's a nifty plugin here: https://github.com/fieldOfView/LinearAdvanceSettingPlugin
It adds a couple of settings to the sidebar that can be used in start/end gcode snippets.

Nice, I didn't know about that one.

It looks like that implements the use case that was the underlying issue here then. For the issue itself, we would prefer to keep the start/end g-codes a machine setting rather than a normal setting.

Was this page helpful?
0 / 5 - 0 ratings