Fan ramp up gcode  

  RSS
karl.w2
(@karl-w2)
Estimable Member

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 karl.w2:

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.

This topic was modified 1 year ago 2 times by karl.w2
Posted : 14/11/2019 6:02 pm
bobstro
(@bobstro)
Illustrious Member

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...
Posted : 14/11/2019 6:31 pm
Sembazuru
(@sembazuru)
Prominent Member

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.

This post was modified 1 year ago by Sembazuru
See my (limited) designs on:
PrusaPrinters - https://www.prusaprinters.org/social/1448-sembazuru/prints
Thingiverse - https://www.thingiverse.com/Sembazuru/designs...
Posted : 14/11/2019 8:13 pm
-- liked
karl.w2
(@karl-w2)
Estimable Member
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.

Posted : 14/11/2019 8:15 pm
--
 -2
(@-2)
Illustrious Member

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 1 year ago by --
It is always wise to get more than one opinion... as for trusting Prusa? No way man....
Posted : 14/11/2019 8:44 pm
Sembazuru
(@sembazuru)
Prominent Member
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:
PrusaPrinters - https://www.prusaprinters.org/social/1448-sembazuru/prints
Thingiverse - https://www.thingiverse.com/Sembazuru/designs...
Posted : 14/11/2019 10:11 pm
karl.w2
(@karl-w2)
Estimable Member

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.

Posted : 14/11/2019 10:51 pm
-- and Sembazuru liked
Share:

Please Login or Register