# Cant get Slicer to enable Aux fan

**URL:** <https://klipper.discourse.group/t/cant-get-slicer-to-enable-aux-fan/20513>\
**Category:** General Discussion\
**Created:** [December 7, 2024, 3:05am UTC](https://klipper.discourse.group/t/cant-get-slicer-to-enable-aux-fan/20513 "2024-12-07T03:05:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![obsidianwraith](https://avatars.discourse-cdn.com/v4/letter/o/d78d45/32.png) [@obsidianwraith](https://klipper.discourse.group/u/obsidianwraith)\
**Post date:** [December 7, 2024, 3:05am UTC](https://klipper.discourse.group/t/cant-get-slicer-to-enable-aux-fan/20513/1 "2024-12-07T03:05:30Z")

</div>

### 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](https://klipper.discourse.group/uploads/short-url/xYR0MHdPlCdPkBoHQ2VRRIi5nuQ.zip) (1.4 MB)

---

<div class="post-metadata">

**Author:** ![theophile](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/theophile/32/31_2.png) [@theophile](https://klipper.discourse.group/u/theophile)\
**Post date:** [December 7, 2024, 5:15am UTC](https://klipper.discourse.group/t/cant-get-slicer-to-enable-aux-fan/20513/2 "2024-12-07T05:15:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![obsidianwraith](https://avatars.discourse-cdn.com/v4/letter/o/d78d45/32.png) [@obsidianwraith](https://klipper.discourse.group/u/obsidianwraith)\
**Post date:** [December 7, 2024, 5:52am UTC](https://klipper.discourse.group/t/cant-get-slicer-to-enable-aux-fan/20513/3 "2024-12-07T05:52:09Z")

</div>

![79kvw9fnaz4e1](https://global.discourse-cdn.com/free1/uploads/klipper/original/3X/7/b/7bed07c76572a9952e9c51cde3f376e911cc33cb.jpeg)  
 ![Capture](https://global.discourse-cdn.com/free1/uploads/klipper/original/3X/5/b/5bce89bd13da44d1e00acdc4a5e00bf0415853d8.jpeg)

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.

 ![Capture2](https://global.discourse-cdn.com/free1/uploads/klipper/original/3X/5/b/5b7a4847c53b1dd1f8bbc5132f42d91dd7d583de.jpeg)

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [December 7, 2024, 7:49am UTC](https://klipper.discourse.group/t/cant-get-slicer-to-enable-aux-fan/20513/4 "2024-12-07T07:49:52Z")

</div>

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:

```auto
[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.

---

<div class="post-metadata">

**Author:** ![obsidianwraith](https://avatars.discourse-cdn.com/v4/letter/o/d78d45/32.png) [@obsidianwraith](https://klipper.discourse.group/u/obsidianwraith)\
**Post date:** [December 7, 2024, 9:18am UTC](https://klipper.discourse.group/t/cant-get-slicer-to-enable-aux-fan/20513/5 "2024-12-07T09:18:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![obsidianwraith](https://avatars.discourse-cdn.com/v4/letter/o/d78d45/32.png) [@obsidianwraith](https://klipper.discourse.group/u/obsidianwraith)\
**Post date:** [December 7, 2024, 10:14pm UTC](https://klipper.discourse.group/t/cant-get-slicer-to-enable-aux-fan/20513/6 "2024-12-07T22:14:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [January 7, 2025, 8:14am UTC](https://klipper.discourse.group/t/cant-get-slicer-to-enable-aux-fan/20513/7 "2025-01-07T08:14:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
