This is a quick model to find the best cooling speed for your specific filament and cooling solution. If you have loud fans like on a ratrig, eva 3.1, hevort, etc. You can use this model to find a quet fan speed to used.
The model is 100mm tall and the stick is 5mm in diameter but you can scale Z height.
To slice these files 20% infill or below and 2 or 3 perimeters should work, try to keep the inside of the tube as empty as possible.
As a baseline you should print one test with no cooling but it's up to you.
This test is mainly to figure out a silent fan speed that works and then use dynamic fan speed at better values for overhangs. This way the printer can be silent most of the times only using a loud fan value when necesary.
This model comes with a custom macro that automates the fan speed:
[gcode_macro SETUP_FAN_CONTROL_ON]
gcode:
{% set start_layer = printer["gcode_macro MISC_MACRO_VARIABLES"].start_layer | default(10) %}
{% set end_layer = printer["gcode_macro MISC_MACRO_VARIABLES"].end_layer | default(50) %}
{% set steps = printer["gcode_macro MISC_MACRO_VARIABLES"].steps | default(5) %}
{% set last_fan_speed = printer["gcode_macro MISC_MACRO_VARIABLES"].last_fan_speed | default(255) %}
# Enable the fan speed control
SET_GCODE_VARIABLE MACRO=FAN_SPEED_CONTROL VARIABLE=enabled VALUE=True
RESPOND PREFIX="Fan test:" COLOR=info MSG="Starting fan test"
RESPOND PREFIX="Fan test:" COLOR=warning MSG="Remember to slice file with no cooling fans enabled"
RESPOND PREFIX="Fan test:" COLOR=info MSG="Start layer: {start_layer}, End layer: {end_layer}, Steps: {steps}, Final fan speed: {last_fan_speed}"
[gcode_macro SETUP_FAN_CONTROL_OFF]
gcode:
# Disable the fan speed control
SET_GCODE_VARIABLE MACRO=FAN_SPEED_CONTROL VARIABLE=enabled VALUE=False
RESPOND PREFIX="Fan test:" COLOR=info MSG="Ending fan test"
[gcode_macro FAN_SPEED_CONTROL]
variable_enabled: False
variable_last_fan_speed: 255
variable_last_fan_speed_step: -1
gcode:
{% if enabled %}
{% set start_layer = printer["gcode_macro MISC_MACRO_VARIABLES"].start_layer | default(10) %}
{% set end_layer = printer["gcode_macro MISC_MACRO_VARIABLES"].end_layer | default(50) %}
{% set steps = printer["gcode_macro MISC_MACRO_VARIABLES"].steps | default(5) %}
{% set current_layer = printer["gcode_macro _USER_ON_LAYER_CHANGE"].user_layer_number %}
{% if current_layer >= start_layer and current_layer <= end_layer %}
{% set total_layers = end_layer - start_layer %}
{% set total_steps = (total_layers / steps) | round(0, 'ceil') | int %}
{% set current_step = ((current_layer - start_layer) / steps) | round(0, 'floor') | int %}
{% if current_step != last_fan_speed_step %}
{% set fan_speed = 255 - (255 * current_step / total_steps) %}
{% set fan_speed = [fan_speed|int, 0]|max %}
M106 S{fan_speed} # Set fan speed
SET_GCODE_VARIABLE MACRO=FAN_SPEED_CONTROL VARIABLE=last_fan_speed VALUE={fan_speed}
SET_GCODE_VARIABLE MACRO=FAN_SPEED_CONTROL VARIABLE=last_fan_speed_step VALUE={current_step}
# Log only when fan speed is set
RESPOND PREFIX="Fan test:" COLOR=info MSG="Layer: {current_layer}, Fan Speed: {fan_speed}"
{% endif %}
{% elif current_layer > end_layer and last_fan_speed != 0 %}
M106 S0 # Turn off fan after end layer
SET_GCODE_VARIABLE MACRO=FAN_SPEED_CONTROL VARIABLE=last_fan_speed VALUE=0
# Log when fan is turned off after end layer
RESPOND PREFIX="Fan test:" COLOR=info MSG="Layer: {current_layer}, Fan Speed: 0 (Test ended)"
{% endif %}
{% endif %}
[gcode_macro _USER_ON_LAYER_CHANGE]
variable_user_layer_number: 0 # internal use only. Do not touch!
description: Call it from the slicers after layer change custom gcode. Used to parse current layer.
gcode:
{% set user_layer_number = params.LAYER|int %}
SET_GCODE_VARIABLE MACRO=_USER_ON_LAYER_CHANGE VARIABLE=user_layer_number VALUE={user_layer_number}
FAN_SPEED_CONTROL # Call the fan speed control macro on each layer changeTo start the test run:
SETUP_FAN_CONTROL_ONAnd to end the test run:
SETUP_FAN_CONTROL_OFFTo customize the test you must use variables in a macro:
[gcode_macro MISC_MACRO_VARIABLES]
description: Variables to change the parameters of misc macros
# region Fan test variables
variable_start_layer: 44
variable_end_layer: 217
variable_steps: 5 # Try to set it to a value that is equal to 1mm, ideally 3mm. Usefull to see cooling changes.
# variable_last_fan_speed: 255 # This is the last fan speed that will be used
# endregion Fan test variables
gcode:
ECHO_MISC_MACRO_VARIABLES
[gcode_macro ECHO_MISC_MACRO_VARIABLES]
description: Echo misc macro variables to the console.
gcode:
{% for var, value in printer["gcode_macro MISC_MACRO_VARIABLES"].items() %}
{action_respond_info(var ~ ": " ~ value)}
{% endfor %}
Here's an explanation of the variables:
variable_start_layer: 44This variable is where the test will start. If you want to test the whole model set a value of 1, but if you want to test only where the pipe/tube starts set the correct value, depending on you layer height you will need to customize this.
variable_end_layer: 217The end layer is where the test ends, depending on your layer height you must customize this.
variable_steps: 5The steps is after how many layers the fan speed will increase, it's usefull to clearly visualize the cooling changes. Set this so that the result is 1mm, for example for 0.5mm layer you would set a value of 2 steps, so that the resulting value is 1mm
variable_last_fan_speed: 255The last fan speed is usefull to limit the max fan speed in the test, for example if you where testing with an extreamly powerfull setup or for a cooling sensitive filament like ABS you could limit the cooling to any value from 0 to 255, where 255 is 100%
The author marked this model as their own original creation.