Skip to content

Wiki Gcode update #10456

@Fisheye3D

Description

@Fisheye3D

Is there an existing issue for this feature request?

  • I have searched the existing issues

Is your feature request related to a problem?

As shown here: https://github.com/SoftFever/OrcaSlicer/wiki/Auxiliary-fan The fans need to be named fan 1, fan 2, fan 3 etc, I propose a update to the M106 gcode to be able to name your fans, This allows the M106 P1, P2 etc commands to still work but also allows you to use the fan name.
You just need to name the fan map to what you name your fan in the config.

[gcode_macro M106]
description: "Set fan speed (Orca compatible)"
gcode:
{% set fan_map = {
0: "CPAP", # Orca P0 → CPAP blower
3: "EXHAUST", # Orca P3 → Exhaust
} %}
{% set p = params.P|int if 'P' in params else 0 %}
{% set fan = fan_map[p] if p in fan_map else "cpap" %}
{% set speed = (params.S|float / 255 if 'S' in params else 1.0) %}
SET_FAN_SPEED FAN={fan} SPEED={speed}

[gcode_macro M107]
description: "Turn off fans. No P = all, P# = specific"
gcode:
{% set fan_map = {
0: "CPAP", # CPAP blower
3: "EXHAUST", # Exhaust (or remap as needed)
} %}
{% if 'P' in params %}
{% set p = params.P|int %}
{% if p in fan_map %}
SET_FAN_SPEED FAN={fan_map[p]} SPEED=0
{% else %}
RESPOND PREFIX="warn" MSG="Unknown fan index P{p}"
{% endif %}
{% else %}
# No P → turn off all mapped fans
{% for f in fan_map.values() %}
SET_FAN_SPEED FAN={f} SPEED=0
{% endfor %}
{% endif %}

Which printers will be beneficial to this feature?

All, Klipper

Describe the solution you'd like

Code updated on Wiki for naming of fans.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions