5th elemenet
Posts: 1
Joined: Mon Feb 04, 2019 11:05 am

Feature based layer dependent acceleration changes

Greetings I am trying to come up with a way of altering the acceleration of a print based on the layer that's being printed.

I have the printers acceleration set to 10,000 mm/s2 for swift, non extruding, movements and for simple extrusions. However there are some occasions when I wish to lower the acceleration to help the first extruded part of a line adhere to the previous layer. Usually where overhangs/ angles are involved as there's less filament, on the layer below, for it to stick to.

Up until now I have been using this in the post processing script section.

{REPLACE "; feature outer perimeter\n" "; feature outer perimeter\nM204 S5000\n"} ;

However it comes with one caveat. When using the variable settings wizard any post processing scripts only have any effect if they are placed within the first process. In other words I can have ten different processes lined up, with ten different accelerations defined in the post processing, but simplify3d ignores processes 2-10 and sets the acceleration for the entire print to what is set in process 1. I cannot see this as being anything other than a bug that needs fixing however that doesn't solve the problem.

Simplify3D doesn't come with the ability to manually alter the acceleration settings as standard which, in and of itself, would have avoided this headache completely as it would have been easy to set via the variable settings stuff. So you have to go hunting for different ways to accomplish this.

I do not want to change the entire acceleration of the print job, just the various features being printed, hence the script above.

Is there a way to do this?

I did find this script

{IF "[current_layer_number]==X"}

And thought it showed some promise but couldn't get it to work in any way.

Something like

{{IF "[current_layer_number]>=855"} {REPLACE "; feature outer perimeter\n" "; feature outer perimeter\nM204 S5000\n"}} ;

Or something, like that, but then would also need to know how to set 'If the current layer is greater or equal to X AND less than or equal to Y' and having no idea how to do that.

This does beg the question though. Why on earth can you not alter the acceleration, as standard, in S3D?

Thanks,

Matt.
S3D-Jason
Posts: 1552
Joined: Sun May 31, 2015 6:01 am

Re: Feature based layer dependent acceleration changes

The post-processing script is for commands that will be executed on the final output gcode file, so they operate on the entire file at once. If you want to do multiple operations, you can just keep adding the post-processing script for your first process.

If you want to change the acceleration at different points in the print, one option might be to use the layer change script. For example, you could paste something like this in the Pre Layer Change Script:

Code: Select all

{IF "[current_layer_number]==1"}M204 S500 ; set acceleration for layer 1
{IF "[current_layer_number]==15"}M204 S1000 ; change acceleration at layer 15
{IF "[current_layer_number]==30"}M204 S2000 ; change acceleration again at layer 30
That would let you make changes at whatever layers you want without using any post-processing at all!
5th elemenet
Posts: 1
Joined: Mon Feb 04, 2019 11:05 am

Re: Feature based layer dependent acceleration changes

Yes but that isn't what I want to do.

As I said above I don't want to change the acceleration for the entire printer hence modification of feature types specifically.

I want a way to change the acceleration of extruding moves only on a layer by layer (or process by process) basis. But automatically because adding each layer separately for a thousand layers isn't practical.

Why isn't the option to alter the acceleration for different movement types a thing in one of the standard (if advanced) settings anyway? For a program as feature rich as S3D this seems like a glaring omission.

Edit - I just realised that

{REPLACE "; feature outer perimeter\n" "; feature outer perimeter\nM204 S5000\n"} ;

Isn't even doing what I thought it was doing. I figured this was altering the acceleration just for the feature detailed but it isn't. It's changing the global printer acceleration and unless something changes the acceleration back afterwards it stays exactly where it is.

S3D doesn't even have a feature called 'travel move' so you cannot swap between accelerations on the fly.

The only way that this will be solved really is if the program is updated to allow for separate accelerations to be set for the various movements listed in the speed section. Not to mention a separate acceleration for the bridging section.

This would seem like a particularly good thing to include in an update because it would also allow the program to accurately predict print times without that separate print time prediction thing.
Last edited by 5th elemenet on Sat Jan 18, 2025 1:00 am, edited 1 time in total.
S3D-Jason
Posts: 1552
Joined: Sun May 31, 2015 6:01 am

Re: Feature based layer dependent acceleration changes

If you want all the travel moves to use a different acceleration, you could consider turning on the M101/M102/M103 commands (Edit Process Settings > Output tab). The M101 comes before the extrusion starts, M102 after it stops, and M103 before a potential retraction. So to use a different acceleration for travel moves, you would replace M102/M103 with the M204 command for travel moves.

Many printers also have separate firmware acceleration values for travel vs extruding moves, so depending on what printer you have this can also sometimes be configured in the firmware.
muskan23
Posts: 4
Joined: Thu Jan 16, 2025 6:07 am

Re: Feature based layer dependent acceleration changes

Hello,
Is it possible to add a feature in Simplify3D that can automatically change acceleration based on different actions, like for extruding or travel moves, without needing to change settings for every single layer? It would really help for things like overhangs.
Thanks.
S3D-Jason
Posts: 1552
Joined: Sun May 31, 2015 6:01 am

Re: Feature based layer dependent acceleration changes

muskan23 wrote: Tue Jan 21, 2025 3:49 am Is it possible to add a feature in Simplify3D that can automatically change acceleration based on different actions, like for extruding or travel moves
Yes, the steps I mentioned above can actually be used to do exactly that!

Go to Edit Process Settings > Output tab, and turn on the "Include M101/M102/M103 commands" option. Then go to the Scripts tab and add the following lines to the post processing script:

Code: Select all

{REPLACE "M101" "M204 S1000 ; set print acceleration"}
{REPLACE "M102" "M204 S2000 ; set travel acceleration"}
{REPLACE "M103" "M204 S2000 ; set travel acceleration"}

I should also mention that some firmwares actually allow a single M204 command to set both the printing and travel acceleration separately. For example, Marlin M204 with P and T parameters (instead of the typical S parameter) [https://marlinfw.org/docs/gcode/M204.html].
muskan23
Posts: 4
Joined: Thu Jan 16, 2025 6:07 am

Re: Feature based layer dependent acceleration changes

Thankyou for confirming.

Return to “General Discussion and Tips”