Last active
March 11, 2025 23:46
-
-
Save ShaneDelmore/fe4f68d3a1a0c643ca43f5a1b29d8774 to your computer and use it in GitHub Desktop.
Revisions
-
ShaneDelmore revised this gist
Jan 14, 2025 . 1 changed file with 36 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,24 +6,54 @@ git clone https://github.com/pedrolamas/klipper-virtual-pins.git ./klipper-virtual-pins/install.sh ``` # Add virtual pins to printer.cfg ``` [virtual_pins] [output_pin fan_factor] pin: virtual_pin:fan_factor pwm: True value: 1.0 [output_pin accel_factor] pin: virtual_pin:accel_factor pwm: True value: 1.0 ``` # Configure M106 to use fan_factor ``` [gcode_macro M106] rename_existing: M106.1 gcode: {% set S = params.S|default(0)|int %} {% set P = params.P|default(0)|int %} {% set FACTOR = printer['output_pin fan_factor'].value %} {% set ADJUSTED_S = (S * FACTOR)|round(0)|int %} M106.1 P{P} S{ADJUSTED_S} ``` # Configure SET_VELOCITY_LIMIT to use accel_factor ``` [gcode_macro SET_VELOCITY_LIMIT] rename_existing: SET_VELOCITY_LIMIT_ORIG gcode: {% set accel = params.ACCEL|default(None) %} {% set accel_to_decel = params.ACCEL_TO_DECEL|default(None) %} {% set velocity = params.VELOCITY|default(None) %} {% set factor = printer['output_pin accel_factor'].value %} {% if accel is not none %} {% set adjusted_accel = accel|float * factor %} {% else %} {% set adjusted_accel = None %} {% endif %} {% if accel_to_decel is not none %} {% set adjusted_accel_to_decel = accel_to_decel|float * factor %} {% else %} {% set adjusted_accel_to_decel = None %} {% endif %} SET_VELOCITY_LIMIT_ORIG {% if velocity is not none %}VELOCITY={velocity|float}{% endif %} {% if adjusted_accel is not none %}ACCEL={adjusted_accel|float}{% endif %} {% if adjusted_accel_to_decel is not none %}ACCEL_TO_DECEL={adjusted_accel_to_decel|float}{% endif %} ``` -
ShaneDelmore created this gist
Jan 14, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ # Install klipper-virtual-pins ``` bash cd ~ git clone https://github.com/pedrolamas/klipper-virtual-pins.git ./klipper-virtual-pins/install.sh ``` # Add virtual pin to printer.cfg ``` [virtual_pins] [output_pin fan_multiplier] pin: virtual_pin:fan_multiplier pwm: True value: 1.0 ``` # Configure M106 to use fan_multiplier ``` [gcode_macro M106] rename_existing: M106.1 gcode: {% set S = params.S|default(0)|int %} {% set P = params.P|default(0)|int %} {% set MULTIPLIER = printer['output_pin fan_multiplier'].value %} {% set ADJUSTED_S = (S * MULTIPLIER)|round(0)|int %} M106.1 P{P} S{ADJUSTED_S} ```