Cant get Slicer to enable Aux fan

Basic Information:

Printer Model: Ender 3
MCU / Printerboard: BTT SKR Mini E3 V3
Host / SBC Raspberry pi 4b
klippy.log

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

Okay, so this is a combination Slicer and Firmware issue i think.

i used a fan port and mapped it to be an aux fan in klipper with the fallowing code

[fan_generic aux_fan]
pin: PB15
kick_start_time: 0.1
off_below: 0.1
cycle_time: 0.01
shutdown_speed: 0.0

with this code i can turn on the aux fan at any point from mainsail. But i really just want the slicer to put in the gcode to turn on the aux fan when needed by itself.

I use Orca Slicer and i have it set to turn on the aux fan, but the printer never seems to turn it on, so i think there is a conflict between the slicer and how i have the firmware set up. i just dont know enough to solve this on my own.
klippy (2).zip (1.4 MB)

What is the aux fan supposed to do? Why do you think your slicer knows what it’s supposed to do? What is the slicer putting in the gcode?


the big red thing on my x axis is my aux fan. it provides extra cooling for when i print at high speeds.

Orca Slicer does have a spot specifically for aux fans. im not entirely sure what it puts in the gcode to call on the aux fan to run.

Orca addresses the extra fan as M106 P2, which Klipper does not support natively. You need to add a macro that allows you to do this:

[gcode_macro M106]
description: Enhanced M106 to handle fan scaling for a fan with fan index P2
rename_existing: M106.1
gcode:
  {% set fan_speed_raw = params.S|default(0)|int %}
  {% set fan_index = params.P|default(0)|int %}

  {% if params.P is defined and fan_index == 2 %}
    # Scale the fan speed from 0-255 to 0-1 for the Aux fan
    {% set scaled_speed = (fan_speed_raw / 255.0) %}
    { action_respond_info("Setting Aux fan speed to " ~ (scaled_speed * 100) | round(1) ~ "%") }
    SET_FAN_SPEED FAN=aux_fan SPEED={scaled_speed}
  {% else %}
    # Default fan handling if P2 is not specified
    M106.1 S{fan_speed_raw}
  {% endif %}

Adapt SET_FAN_SPEED FAN=aux_fan SPEED={scaled_speed} to call your fan.

when you say to adapt

Adapt SET_FAN_SPEED FAN=aux_fan SPEED={scaled_speed} to call your fan.

could you go into a bit more detail about this part? I’m not sure what it is I’m adapting.

i did go ahead an make a macro of that gcode that handles the m106 p2 situation, and added the macro to my printer.cfg.

i think i can write a simple gcode file to test if klipper can resolve that M106 02 properly with that macro.

You can disregard that last comment. It worked just the way you had it set up.

Hey Sineos, have I ever told you that your a genius? Cuz your amazing. Thank you so much.

1 Like