Notifications
Clear all

Fan ramp up gcode  

  RSS
Erik
 Erik
(@erik-3)
Estimable Member
Fan ramp up gcode

I'm trying to get my fan to slowly speed up after the first layer, but I can't make anything dynamic. Right now the custom gcode exists in the Printer Settings After layer change G-code section. I'm using this:

{if layer_num == 1}M106 S40{endif}
{if layer_num == 2}M106 S80{endif}

Instead, I'd like to use the parameter min_fan_speed to either calculate the M106 or at least put a few extra if statements to ramp it up faster/slower depending on the value. This can't be done because min_fan_speed is in the Filament Settings section, and isn't a recognized placeholder during slicing.

Is there a way to declare a custom placeholder in the Filament Settings custom g-code section that can be used in the Print Settings? Or maybe I'm able to access Filament Settings placeholders and I'm just not doing it correctly?

Best Answer by Erik:

The fine folks over on Github set me straight. min_fan_speed is an array. You have to use min_fan_speed[current_extruder] to get the actual minimum fan speed.

Napsal : 14/11/2019 6:02 pm
bobstro
(@bobstro)
Illustrious Member
RE: Fan ramp up gcode

The placeholders are fixed and you can't add your own. There's also no real advanced logic capability in the slicer. What you can do is call a post-processing script. I've done a simple script to "blip" the fan speed momentarily to 100% when lower fan speeds wouldn't get the fan spinning. You could combine this with tracking the current layer. Doesn't sound trivial though.

My notes and disclaimers on 3D printing

and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan

Napsal : 14/11/2019 6:31 pm
Sembazuru
(@sembazuru)
Prominent Member
RE: Fan ramp up gcode

Have you verified that "min_fan_speed" isn't a recognized place-holder? After all, "first_layer_temperature" is also in the Filament Settings section and is kind-of the whole point of using place holders. (This is a hint... look how the stock custom start g-code handles "first_layer_temperature" and try using "min_fan_speed" the same way.)

If "min_fan_speed" truly isn't a recognized place-holder then that would be a bug (or at very least inconsistent behavior) and should be reported on Github.

See my (limited) designs on:
Printables - https://www.printables.com/@Sembazuru
Thingiverse - https://www.thingiverse.com/Sembazuru/designs

Napsal : 14/11/2019 8:13 pm
-- se líbí
Erik
 Erik
(@erik-3)
Estimable Member
Topic starter answered:
RE: Fan ramp up gcode
Posted by: @sembazuru

Have you verified that "min_fan_speed" isn't a recognized place-holder? After all, "first_layer_temperature" is also in the Filament Settings section and is kind-of the whole point of using place holders.

If "min_fan_speed" truly isn't a recognized place-holder then that would be a bug (or at very least inconsistent behavior) and should be reported on Github.

I'll go make a report.

Napsal : 14/11/2019 8:15 pm
--
 --
(@)
Illustrious Member
RE: Fan ramp up gcode

I was thinking the same thing; min_fan_speed is right there.  And the math and logic capability at slice time, while not extravagant, should be able to check fan speed conditions at least by layer.  It won't help the intra-layer or bridging problem of fans not starting (perhaps a feature request is to add firmware that kicks the fan at every speed change under a set percentage?), but may help other cases where cooling needs to change more frequently.

ps: this code is a fair example of the power of the place holders...

{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up
This post was modified před 4 years by --
Napsal : 14/11/2019 8:44 pm
Sembazuru
(@sembazuru)
Prominent Member
RE: Fan ramp up gcode
Posted by: @tim-m30

I was thinking the same thing; min_fan_speed is right there.  And the math and logic capability at slice time, while not extravagant, should be able to check fan speed conditions at least by layer.  It won't help the intra-layer or bridging problem of fans not starting (perhaps a feature request is to add firmware that kicks the fan at every speed change under a set percentage?), but may help other cases where cooling needs to change more frequently.

ps: this code is a fair example of the power of the place holders...

{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up

I prefer my code, but yeah... Good indication of the power of place holders.

{if layer_z < max_print_height}G1 Z{z_offset+min((layer_z/max_print_height)*(max_print_height-100)+100, max_print_height)}{endif} ; Move print head up proportionally of print height to max 

See my (limited) designs on:
Printables - https://www.printables.com/@Sembazuru
Thingiverse - https://www.thingiverse.com/Sembazuru/designs

Napsal : 14/11/2019 10:11 pm
Erik
 Erik
(@erik-3)
Estimable Member
Topic starter answered:
RE: Fan ramp up gcode

The fine folks over on Github set me straight. min_fan_speed is an array. You have to use min_fan_speed[current_extruder] to get the actual minimum fan speed.

Napsal : 14/11/2019 10:51 pm
-- a Sembazuru se líbí
Share: