Skip to main content

Fan Reference Configuration

This page organizes common fan configuration methods, including driver fans, 7040 fans, and multiple fans sharing pins. The pins in the examples need to be modified according to the actual motherboard.

Driver Fan​

There are two common ways to drive a fan:

MethodApplicable scenarioDescription
[output_pin]Needs to stay on after power-on or connecting KlipperSimple configuration, will not automatically start or stop based on motor status
[controller_fan]Wants it to turn on automatically when the motor or heater is workingMore suitable for driver cooling fans

Always-On Fan​

value: 1 means the output will automatically turn on after Klipper is connected.

printer.cfg
[output_pin driver_fan]
pin: <driver_fan_pin>
value: 1

Automatic Driver Fan​

printer.cfg
[controller_fan driver_fan]
pin: <driver_fan_pin>
cycle_time: 0.00003
max_power: 1.0
shutdown_speed: 0.0
fan_speed: 0.9
idle_timeout: 90
idle_speed: 0.4
stepper: stepper_x,stepper_y

Parameter description:

  • fan_speed: Fan speed when the motor or heater is working.
  • idle_timeout: How long the fan continues running after the motor stops, in seconds.
  • idle_speed: Fan speed during the idle waiting period.
  • stepper: Associated motor names, multiple can be entered.

7040 Fan​

Some 7040 fans may spin immediately upon power-up or startup. You need to set the PWM initial state during firmware compilation.

Info

In the firmware compilation option GPIO pins to set at micro-controller startup, enter !<fan_pin> to keep the corresponding fan output off at startup. Please modify according to the actual PWM pin. ! must be an English exclamation mark.

Loading...
printer.cfg
[fan]
pin: <fan_pin>
max_power: 0.9
cycle_time: 0.002
hardware_pwm: false
shutdown_speed: 0

Multi-Fan Shared Pin Configuration​

When multiple fans need to be controlled simultaneously, use [multi_pin]. This method is not applicable to stepper motor pins.

printer.cfg
[multi_pin my_fan]
pins: PA1,PA2,PA3,PA4

[fan]
pin: multi_pin:my_fan
Caution

Before sharing pins among multiple fans, confirm that the corresponding MOS tubes and power supply lines can handle the total current.

Loading...