How to get the Controller fan to turn on at power up?

Basic Information:

Printer Model: RatRig v-core 3.0
MCU / Printerboard: BTT Octopus v1.1
klippy.logklippy.log (1.2 MB)

Fill out above information and in all cases attach your klippy.log file. Pasting your printer.cfg is not needed
Be sure to check our Knowledge Base and in particular this and this post

Describe your issue:

…I want the controller fan to come on at power up. Maybe I’m missing something but seems like that should be SOP? I tried this override, which put another fan under “misc” in the dashboard.

[controller_fan my_controller_fan]
pin: PC8
max_power: 1.0
shutdown_speed: 0
cycle_time: 0.010
hardware_pwm: False
kick_start_time: 0.100
off_below: 0.0
#   See the "fan" section for a description of the above parameters.
fan_speed: 1.0
#   The fan speed (expressed as a value from 0.0 to 1.0) that the fan
#   will be set to when a heater or stepper driver is active.
#   The default is 1.0
idle_timeout: 30
#   The amount of time (in seconds) after a stepper driver or heater
#   was active and the fan should be kept running. The default
#   is 30 seconds.
idle_speed: 1.0
#   The fan speed (expressed as a value from 0.0 to 1.0) that the fan
#   will be set to when a heater or stepper driver was active and
#   before the idle_timeout is reached. The default is fan_speed.
heater: extruder
stepper: stepper_x, stepper_y, stepper_z, stepper_z1, stepper_z2
#   Name of the config section defining the heater/stepper that this fan
#   is associated with. If a comma separated list of heater/stepper names
#   is provided here, then the fan will be enabled when any of the given
#   heaters/steppers are enabled. The default heater is "extruder", the
#   default stepper is all of them.

Does not work with controller_fan as this setting is bound to the criteria as described.

Use a generic fan and pull it up either with a delayed gcode or a static pin.

1 Like

do you want to enable the pins at printer mainboard startup?
if so u can add the pin ( PC8 in your case ) here at the “gpio pins to set at micro-controller startup”, recompile the firmware and reflash it


/edit: if you are using a skr2 board, also enable the PC13 pin in the “gpio pins to set at micro-controller startup”, in your example: PC13, PC8 - “gpio pins to set at micro-controller startup” is a comma seperated list

I have a similar situation, I have one fan that sits over my electronics and want to keep it at an idle speed to keep the pi cool but also hit active speed when my motor drivers are active. The current way the controller fan works is that it only stays in the idle speed for however long you set the timer for. I made the option of keeping it going by adding in a -1 value that would disable the timeout feature. This means that it will run at active speed when called for but any other time it will be at the idle speed including on start up.

I made a pull request on this feature so we will see if it gets adopted.

1 Like

Hi, could you please elaborate on how this is done? I’ve added a 140mm fan for cooling my electronics, mainly the 5160 drivers. Can’t get it to work like I want it to because [controller_fan] won’t let the fan run unless any stepper is enabled, and I want some cooling all the time

Just hook up the fan to 12V or 24V if you do not want to have it controlled?

I don’t want it to run at 100% all the time,
what I’d like is for the fan to be at idle speed all the time. And when the steppers are enabled the fan increase to it’s active speed state


Look at the controller fan section in the fan section of the documentation, that should help you.

Happy Printing,

Yeah well, I’ve gone through that pretty thorough.
It works and all, but the fan won’t start when booting. which means I have to turn the fan on manually every time in order to cool the electronics. Which I’ll def forget. And after the idle time runs out the fan dies cause I cant specify a value thats not 0 or 1


Hmmm, mine works, I wonder why yours doesn’t. Could be a weird configuration bug.

Happy Printing,

This is not possible with controller_fan.
What you could do is:

[fan_generic electronics]
pin: whatever

[delayed_gcode start_fan_at_idle_speed]
initial_duration: 1.
  SET_FAN_SPEED FAN=electronics SPEED=0.3

In addition, amend your start macro or gcode with SET_FAN_SPEED FAN=electronics SPEED=1. and your end macro / gcode with SET_FAN_SPEED FAN=electronics SPEED=0.3

Thanks, that would work, however I need the fan to increase if a driver is enabled even when I’m not printing. For tests + I always run some homing and probing stuff before starting a print
( that I don’t want in the print_start cause they’re not needed if I run multiple prints after each other )

I hacked together this, which seems to work. But I know it’s not meant to be used that way, and perhaps it could create other issues (?)

[fan_generic electronics]
pin: PD12
max_power: 1.0
shutdown_speed: 1.0
kick_start_time: 1

[delayed_gcode start_fan_at_idle_speed]
initial_duration: 1.
SET_FAN_SPEED FAN=electronics SPEED=0.3

pins: PD12

[controller_fan electronics2]
pin: PD12

It does make both “fans” run simultaneously when the controller fan is running. Shouldn’t matter all that much I guess?


Ever thought of silent fans?

That’s why I opted for this :wink: doesn’t get much more silent than this. This replaces the loud stock solution of four 4010 fans that was used for the drivers + that it cools the rest of the electronics a lot better too.

Next up are replacements for the obnoxious fans Meanwell puts in their PSUs

1 Like

I don’t know much space there is, but what’s about dedicated fans?
One for the MCU and others for the high power drivers

Well, of course this works. You can also define macros that will pull up the fan before probing etc.

To be honest, I do not think it is needed. Probing and testing usually does not warrant extra cooling, but if it makes you happy :wink:

It’s pretty tight. but I might be able to squeeze in a small fan to cover the Pi at least Will check :slight_smile:

Perhaps I’m just paranoid and over-estimating how hot the external 48v 5160 drivers will get :stuck_out_tongue:
That would def be the easiest solution lol.

Here is the pull request I had in a while ago. I modified the file to allow for idle at all times until the motors turn on. At that point it ramps up to full power.

1 Like

I had a similar issue, after turning on printer I noticed the Pi getting a bit too warm for comfort… a search brought me here…

The code above was perfect, on power on I set the fan start at 20%, perfect for idle as the Pi stays cool. Then on it ramps up to 50% on stepper movement (same fan cools the drivers)…

I left the original [controller_fan Pi] in place and added [fan_generic electronics] and [duplicate_pin_override]… everything works a treat… many thanks…

1 Like