добавлена щетка, смещение тача, переписан авд, праймлайн на тпу
This commit is contained in:
322
addon/OrbiterSensor.cfg
Normal file
322
addon/OrbiterSensor.cfg
Normal file
@@ -0,0 +1,322 @@
|
||||
#################################################################################################################
|
||||
################################# Orbiter Sensor CONFIGURATION ##################################################
|
||||
#################################################################################################################
|
||||
|
||||
#config file version v2.2.04
|
||||
#release date: 23.09.2023
|
||||
|
||||
# PAUSE and RESUME macros are defined at the end of this config file.
|
||||
# If you prefer using your own p[lease delete them, otherwise define parking position below.
|
||||
|
||||
#################################################################################################################
|
||||
################################# CHANGE HERE MACRO CONFIGURABLES################################################
|
||||
#################################################################################################################
|
||||
|
||||
[gcode_macro _SENSOR_VARIABLES] # change here macro configurables, enable disable functions!*************************
|
||||
variable_filament_load_temp :230 # temperature to heat up hotend for filament loading, default is 235
|
||||
variable_filament_unload_temp :200 # temperature to heat up hotend for filament un-loading, default is 185
|
||||
variable_filament_load_min_temp :200 # minimum hotend set temperature allowed in filament load macro, default is 190
|
||||
variable_nozzle_purge_length :160 # filament extrude amount during load sequenc, hotend purge from old filament, default is 200
|
||||
variable_nozzle_purge_speed :450 # filament extrude speed in mm/min adjust this value lower if flow is too high and extruder skips during loading, default is 300
|
||||
variable_unload_distance :120 # filament retract distance for unload procedure. this length shall be long enough to extract the filament above the drive gears
|
||||
variable_disable_autoload :False # disable filament autoload feature by setting this variable True
|
||||
variable_disable_runnout :False # disable runnout by setting this variable True
|
||||
variable_disable_autounload :False # disable auto unload filament by setting this variable to True
|
||||
variable_enable_beep :True # uses M300 sound feature, set it True to enable
|
||||
variable_park_position_x :10 # edit your X parking position here for pause macro trigerred by runnout
|
||||
variable_park_position_y :10 # edit your Y parking position here for pause macro trigerred by runnout
|
||||
variable_park_lift_z :10 # edit your Z lift amount for parking position here, default is 10
|
||||
Variable_park_retraction :1 # edit your retraction amount for parking, default is 1
|
||||
gcode:
|
||||
|
||||
#///////////////////////////filament sensor button macros/////////////////////////////////////////////////
|
||||
[gcode_button filament_sense]
|
||||
pin: !toolboard: PB5 # remove the negation "!" for sensor v1 - use just PA9 as example
|
||||
press_gcode: # sensor released -runnout detected!
|
||||
runnout_init
|
||||
release_gcode: #gcode macro for filament auto-load, sensor pressed
|
||||
filament_load_init
|
||||
#********************************************************************************************************
|
||||
|
||||
#////////////////////////////////////////Filament Unload macros/////////////////////////////////////////////////
|
||||
[gcode_button filament_unload]
|
||||
pin: !toolboard: PB7 # remove the negation "!" for sensor v1 - use just PA9 as example
|
||||
release_gcode: # filament unload procedure
|
||||
filament_unload_init
|
||||
press_gcode: # do not add any macro call here
|
||||
|
||||
#################################################################################################################################
|
||||
####################################### DO NOT CHANGE ANYTHING BELOW THIS LINE!!! ###############################################
|
||||
#################################################################################################################################
|
||||
####################################### UNLESS YOU KNOW WHAT YOU ARE DOING OR YOU ARE BORED AND NEED TO DO SOMETHING OR YOU ARE ALONE AND NEED SOMETHING TO MESS UP YOUR LIFE OR YOU CAN DO IT BETTER THAN ME OR YOU ARE A REAL SMARTASS OR JUST BECAUSE YOU CAN OR YOU RUN OUT OF BEAR OR HAS NOTHING BETTER TO DO OR ANY UNREASONABLE REASON
|
||||
#################################################################################################################################
|
||||
|
||||
[respond]
|
||||
default_type: echo
|
||||
|
||||
[force_move]
|
||||
enable_force_move: True
|
||||
|
||||
[gcode_macro runnout_init]
|
||||
gcode:
|
||||
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
|
||||
{% if (printer.print_stats.state == "printing") %}
|
||||
{% if(sensor.disable_runnout|lower == 'false') %}
|
||||
filament_change_state1
|
||||
{% else %}
|
||||
M118 Filament runnout is disabled in the sensor config file!
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
UPDATE_DELAYED_GCODE ID=clear_loadbusy DURATION=2
|
||||
UPDATE_DELAYED_GCODE ID=clear_unloadbusy DURATION=2
|
||||
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=filamentpresent VALUE=0
|
||||
|
||||
[gcode_macro filament_change_state1]
|
||||
variable_changebusy: 0
|
||||
variable_temp_target: 0
|
||||
gcode:
|
||||
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
|
||||
{% if changebusy == 0 %}
|
||||
PAUSE # call printer pause macro
|
||||
SET_GCODE_VARIABLE MACRO=filament_change_state1 VARIABLE=changebusy VALUE=1
|
||||
M118 Filament runnout!
|
||||
filament_change_state2 # comment this line if you do not want to automatically unload filament in case there is a runnout detected.
|
||||
{% else %}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro filament_change_state2]
|
||||
gcode:
|
||||
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
|
||||
SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=1
|
||||
{% if (sensor.enable_beep|lower == 'true') %}
|
||||
M300 # beep sound
|
||||
{% endif %}
|
||||
M118 Unloading filament...
|
||||
M83
|
||||
G92 E0
|
||||
# {% if printer[printer.toolhead.extruder].temperature < 185 %} # hardcoded threshold
|
||||
{% if (printer.extruder.can_extrude|lower != 'true')%} # checing for minimum extrusion temperature
|
||||
# check if temperature is over the minimum extrusion temp. min_extrude_temp must be defined in the extruder config (to about 185)
|
||||
M118 Hotend heating!
|
||||
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={sensor.filament_unload_temp} # restore user temp if it was set before loading
|
||||
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={sensor.filament_unload_temp} #wait for reaching filament unload temp
|
||||
{% endif %}
|
||||
{% if(printer.extruder.target == 0) %} # checing for set temperature if is zero than set to 200 / hotend hot but cooling due to set target temp 0
|
||||
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={sensor.filament_unload_temp} # restore user temp if it was set before loading
|
||||
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={sensor.filament_unload_temp} #wait for reaching filament unload temp
|
||||
{% endif %}
|
||||
G0 E-5 F3600 #extract filament to cold end
|
||||
G4 P2000 # wait for two seconds
|
||||
G0 E5 F3600 # push the filament back
|
||||
G0 E-5 F3600 #extract filament to cold end
|
||||
G0 E-{sensor.unload_distance} F300 # continue extraction slow allow filament to be cooled enough before reaches the gears
|
||||
M400
|
||||
M118 Load new filament! Wait until is loaded, then resume printing.
|
||||
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=0 # swicth off heater
|
||||
UPDATE_DELAYED_GCODE ID=clear_loadbusy DURATION=2.5 # timing must be set to clear delay plus 0.5s. is due to wait to remove filament before starting load even in case there is a blob at the tip of the extracted filament which woudl trigger the sensor twice
|
||||
|
||||
#############################################END filament auto load macro section END***********************************************************
|
||||
|
||||
[gcode_macro filament_load_init]
|
||||
gcode:
|
||||
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
|
||||
{% if (printer.print_stats.state != "printing") %}
|
||||
{% if(sensor.disable_autoload|lower == 'false') %}
|
||||
filament_load
|
||||
{% else %}
|
||||
M118 Filament auto-load is disabled in the sensor config file!
|
||||
{% endif %}
|
||||
{% else %}
|
||||
M118 Printing! Can't load filament right now!
|
||||
{% endif %}
|
||||
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=filamentpresent VALUE=1
|
||||
UPDATE_DELAYED_GCODE ID=clear_changebusy DURATION=2
|
||||
|
||||
[gcode_macro filament_load]
|
||||
variable_loadbusy: 0
|
||||
variable_USER_TEMP: 0
|
||||
variable_LOAD_TEMP: 0
|
||||
gcode:
|
||||
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
|
||||
{% if loadbusy == 0 %} # requires [virtual_sdcard]
|
||||
SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=1
|
||||
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=unloadbusy VALUE=1
|
||||
{% set USER_TEMP = printer.extruder.target %} # save user set temperature before loading
|
||||
{% set LOAD_TEMP = 0 %}
|
||||
#M118 USER TEMP {USER_TEMP} # echo back for debug only
|
||||
{% if (printer.extruder.can_extrude|lower != 'true') or (printer.extruder.target < sensor.filament_load_min_temp) %} # checking for minimum extrusion temperature
|
||||
# check if temperature is over the minimum extrusion temp. min_extrude_temp must be defined in the extruder config (to about 185)
|
||||
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={sensor.filament_load_temp} # set user defined load temperature
|
||||
{% set LOAD_TEMP = sensor.filament_load_temp %} # save user set temperature before loading
|
||||
M118 Hotend heating!
|
||||
{% endif %}
|
||||
{% if (sensor.enable_beep|lower == 'true') %}
|
||||
M300 # beep sound
|
||||
{% endif %}
|
||||
M118 Filament loading!
|
||||
M82 #set extruder to absolute mode
|
||||
G92 E0
|
||||
G4 P1500 # wait for 1.5 seconds
|
||||
FORCE_MOVE STEPPER=extruder DISTANCE=15 VELOCITY=10 ACCEL=1000 # load filament inside the gears force move needs to be enabled
|
||||
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={LOAD_TEMP} # wait for reaching set temperature
|
||||
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={USER_TEMP} # wait for reaching set temperature
|
||||
G1 E{sensor.nozzle_purge_length} F{sensor.nozzle_purge_speed} # extrude preconfigured purge length
|
||||
M400 # wait to complete nozzle purge
|
||||
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={USER_TEMP} # restore user temp if it was set before loading
|
||||
M118 Filament load complete!
|
||||
UPDATE_DELAYED_GCODE ID=clear_unloadbusy DURATION=2
|
||||
{% else %}
|
||||
M118 Filament already loaded!
|
||||
{% endif %}
|
||||
#############################################END filament suto load macro section END***********************************************************
|
||||
#############################################filament auto unload macro section*****************************************************************
|
||||
[gcode_macro filament_unload_init]
|
||||
gcode:
|
||||
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
|
||||
{% if (printer.print_stats.state != "printing") %}
|
||||
{% if(sensor.disable_autounload|lower == 'false') %}
|
||||
filament_unload
|
||||
{% else %}
|
||||
M118 Filament auto-unload is disabled in the sensor config file!
|
||||
{% endif %}
|
||||
{% else %}
|
||||
M118 Printing! Can't unload filament right now!
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro filament_unload]
|
||||
variable_unloadbusy: 0
|
||||
variable_filamentpresent: 0
|
||||
gcode:
|
||||
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
|
||||
{% if unloadbusy == 0 %} # requires [virtual_sdcard]
|
||||
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=unloadbusy VALUE=1
|
||||
SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=1
|
||||
{% if (sensor.enable_beep|lower == 'true') %}
|
||||
M300 # beep sound
|
||||
{% endif %}
|
||||
M118 Filament unloading!
|
||||
M83
|
||||
G92 E0
|
||||
# {% if (printer.extruder.can_extrude|lower != 'true') or (printer.extruder.target == 0)%} # checing for minimum extrusion temperature
|
||||
{% if (printer.extruder.can_extrude|lower != 'true')%} # checing for minimum extrusion temperature
|
||||
# check if temperature is over the minimum extrusion temp. min_extrude_temp must be defined in the extruder config (to about 185)
|
||||
M118 Hotend heating!
|
||||
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={sensor.filament_unload_temp} # restore user temp if it was set before loading
|
||||
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={sensor.filament_unload_temp} # wait for reaching configured unload temperature
|
||||
{% endif %}
|
||||
{% if(printer.extruder.target == 0) %} # checing for set temperature if is zero than set to 185 / hotend hot but cooling due to set target temp 0
|
||||
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={sensor.filament_unload_temp} # wait for reaching configured unload temperature
|
||||
{% endif %}
|
||||
G0 E10 F500 # extruder 20mm of filament before extracting
|
||||
G0 E-5 F3600 #extract filament to cold end
|
||||
G4 P2000 # wait for two seconds
|
||||
G0 E6 F3600 # push the filament back
|
||||
G0 E-10 F3600 #extract filament to cold end
|
||||
G0 E-{sensor.unload_distance} F300 # continue extraction slow allow filament to be cooled enough before reaches the gears
|
||||
M104 S0 T0
|
||||
M400 # wait to complete unload
|
||||
M118 Filament unload complete!
|
||||
#SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=0
|
||||
{% else %}
|
||||
M118 Nothing to unload!
|
||||
{% endif %}
|
||||
|
||||
#############################################END filament auto unload macro section END***********************************************************
|
||||
|
||||
[delayed_gcode clear_unloadbusy]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=unloadbusy VALUE=0
|
||||
#M118 Clear Unload busy!
|
||||
|
||||
[delayed_gcode clear_changebusy]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=filament_change_state1 VARIABLE=changebusy VALUE=0
|
||||
#M118 Clear Load busy!
|
||||
|
||||
[delayed_gcode set_loadbusy]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=1
|
||||
#M118 Set Load busy!
|
||||
|
||||
[delayed_gcode clear_loadbusy]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=0
|
||||
#M118 Clear Load busy!
|
||||
|
||||
|
||||
#################################################################################################################################
|
||||
##################### DELETE PAUSE AND RESUME MACROS IF YOU WANT TO USE YOUR OWN ONES!###########################################
|
||||
#################################################################################################################################
|
||||
|
||||
[gcode_macro PAUSE]
|
||||
rename_existing: BASE_PAUSE
|
||||
gcode:
|
||||
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
|
||||
{% set x = params.X|default(sensor.park_position_x) %}
|
||||
{% set y = params.Y|default(sensor.park_position_y) %}
|
||||
{% set z = params.Z|default(sensor.park_lift_z)|float %}
|
||||
{% set e = params.E|default(sensor.park_retraction) %}
|
||||
##### calculate save lift position #####
|
||||
{% set max_z = printer.toolhead.axis_maximum.z|float %}
|
||||
{% set act_z = printer.toolhead.position.z|float %}
|
||||
{% set lift_z = z|abs %}
|
||||
{% if act_z < (max_z - lift_z) %}
|
||||
{% set z_safe = lift_z %}
|
||||
{% else %}
|
||||
{% set z_safe = max_z - act_z %}
|
||||
{% endif %}
|
||||
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=bed_restore_temp VALUE={printer.heater_bed.target}
|
||||
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=extruder_restore_temp VALUE={printer.extruder.target}
|
||||
##### end of definitions #####
|
||||
SAVE_GCODE_STATE NAME=PAUSE_state
|
||||
BASE_PAUSE
|
||||
G91
|
||||
G1 E-{e} F2100
|
||||
G1 Z{z_safe}
|
||||
G90
|
||||
G1 X{x} Y{y} F6000
|
||||
# SET_LED LED=OrbiLED RED=1.0 GREEN=1.0 BLUE=0.0
|
||||
|
||||
[gcode_macro RESUME]
|
||||
rename_existing: BASE_RESUME
|
||||
variable_bed_restore_temp:0
|
||||
variable_extruder_restore_temp:0
|
||||
gcode:
|
||||
##### set defaults #####
|
||||
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
|
||||
M118 Restoring heaters temperature, it might take a whyle!
|
||||
M140 S{bed_restore_temp}
|
||||
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={bed_restore_temp}
|
||||
M104 S{extruder_restore_temp}
|
||||
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={extruder_restore_temp}
|
||||
{% set e = params.E|default(sensor.park_retraction) %}
|
||||
G91
|
||||
G1 E{e} F2100
|
||||
G90
|
||||
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
|
||||
BASE_RESUME
|
||||
# SET_LED LED=OrbiLED RED=1.0 GREEN=1.0 BLUE=1.0
|
||||
|
||||
# config file version v2.2.04 change note
|
||||
# Commented ou the set Orbiled commands.
|
||||
|
||||
|
||||
# config file version v2.2.03 change note
|
||||
# 1 - defined user variables at the begining of the file for easier macro parameters adjustment
|
||||
# 2 - defined disable configuration of features
|
||||
# 3 - included PAUSE and RESUME macros with restoring bed and hotend temperature featres.
|
||||
|
||||
# config file version v2.2.02 change note
|
||||
# 1 - filament loading will not set hotend temperature to zero in case the hotend was already set hot before the loading / filament change procedure
|
||||
# 2 - Filament load / unload waits for hotend to reach temp not to reach stabilized temperature - faster filament loading and unloading.
|
||||
# 3 - Removed messages to screen, only console echo is present
|
||||
# 4 - Panel beep replaced by M300 / comment it out if not available on your printer
|
||||
# 5 - unload procedure changed for better filament tip forming.
|
||||
# 6 - known issue - if printer paused due to runout detection and new filament is not loaded whiting Klipper heaters timeout period (default is 10min) the heaters will be switched OFF.
|
||||
# If user loads new filament autoload with work with its default loading temperature of 230 deg C but the heaters temperature will not be restored afterwards user needs to set back heaters temperature.
|
||||
# on my printer this timeout also causes loosing of extruder position and printing can be resumed only after homing first and setting back temperatures manually.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
254
addon/stealthburner_leds.cfg
Normal file
254
addon/stealthburner_leds.cfg
Normal file
@@ -0,0 +1,254 @@
|
||||
# Macros for setting the status leds on the Voron StealthBurner toolhead (or for any neopixel-type leds).
|
||||
#
|
||||
# You will need to configure a neopixel (or other addressable led, such as dotstar). See
|
||||
# https://www.klipper3d.org/Config_Reference.html#neopixel for configuration details.
|
||||
|
||||
|
||||
#####################################
|
||||
# INSTRUCTIONS #
|
||||
#####################################
|
||||
# How to use all this stuff:
|
||||
#
|
||||
# 1. Copy this .cfg file into your Klipper config directory and then add [include stealthburner_leds.cfg]
|
||||
# to the top of your printer.cfg in order to register the LEDs and macros with Klipper.
|
||||
# 2. Define your LEDs by editing [neopixel sb_leds] below and entering the data pin from your control board
|
||||
# as well as the color order.
|
||||
#
|
||||
# Note: RGB and RGBW are different and must be defined explicitly. RGB and RGBW are also not able to
|
||||
# be mix-and-matched in the same chain. A separate data line would be needed for proper functioning.
|
||||
#
|
||||
# RGBW LEDs will have a visible yellow-ish phosphor section to the chip. If your LEDs do not have
|
||||
# this yellow portion, you have RGB LEDs.
|
||||
#
|
||||
# 3. Save your config and restart Klipper.
|
||||
#
|
||||
# Note: We set RED and BLUE to 1.0 to make it easier for users and supporters to detect
|
||||
# misconfigurations or miswiring. The default color format is for Neopixels with a dedicated
|
||||
# white LED. On startup, all three SB LEDs should light up.
|
||||
#
|
||||
# If you get random colors across your LEDs, change the color_order to GRB and restart. Then
|
||||
# omit the W for each suggested color_order in the next paragraph.
|
||||
#
|
||||
# If you get MAGENTA, your color order is correct. If you get CYAN, you need to use RGBW. If
|
||||
# you get YELLOW, you need to use BRGW (note that BRG is only supported in the latest Klipper
|
||||
# version).
|
||||
#
|
||||
# 4. Once you have confirmed that the LEDs are set up correctly, you must now decide where you want
|
||||
# these macros called up...which means adding them to your existing gcode macros. NOTHING will happen
|
||||
# unless you add the STATUS_????? macros to your existing gcode macros.
|
||||
#
|
||||
# Example: add STATUS_LEVELING to the beginning of your QGL gcode macro, and then add STATUS_READY
|
||||
# to the end of it to set the logo LED and nozzle LEDs back to the `ready` state.
|
||||
#
|
||||
# Example: add STATUS_CLEANING to the beginning of your nozzle-cleaning macro, and then STATUS_READY
|
||||
# to the end of it to return the LEDs back to `ready` state.
|
||||
#
|
||||
# 5. Feel free to change colors of each macro, create new ones if you have a need to. The macros provided below
|
||||
# are just an example of what is possible. If you want to try some more complex animations, you will most
|
||||
# likely have to use WLED with Moonraker and a small micro-controller
|
||||
#
|
||||
#####################################
|
||||
# END INSTRUCTRUCTIONS #
|
||||
#####################################
|
||||
|
||||
|
||||
[neopixel sb_leds]
|
||||
pin: EBBCan:gpio16
|
||||
# The pin connected to the neopixel. This parameter must be provided.
|
||||
chain_count: 3
|
||||
# The number of Neopixel chips that are "daisy chained" to the
|
||||
# provided pin. The default is 1 (which indicates only a single
|
||||
# Neopixel is connected to the pin).
|
||||
color_order: GRB
|
||||
# Set the pixel order required by the LED hardware. Options are GRB,
|
||||
# RGB, GRBW, or RGBW. The default is GRB.
|
||||
initial_RED: 1.0
|
||||
initial_GREEN: 0.0
|
||||
initial_BLUE: 0.0
|
||||
initial_WHITE: 0.0
|
||||
# Sets the initial LED color of the Neopixel. Each value should be
|
||||
# between 0.0 and 1.0. The WHITE option is only available on RGBW
|
||||
# LEDs. The default for each color is 0.#
|
||||
|
||||
# Most configuration for the macros can be done by modifying the variables in the _sb_vars macro
|
||||
# at the start of this file.
|
||||
|
||||
##########
|
||||
# MACROS #
|
||||
##########
|
||||
|
||||
# The following status macros are available (these go inside of your macros):
|
||||
#
|
||||
# STATUS_READY
|
||||
# STATUS_OFF
|
||||
# STATUS_BUSY
|
||||
# STATUS_HEATING
|
||||
# STATUS_LEVELING
|
||||
# STATUS_HOMING
|
||||
# STATUS_CLEANING
|
||||
# STATUS_MESHING
|
||||
# STATUS_CALIBRATING_Z
|
||||
#
|
||||
# With additional macros for basic control:
|
||||
#
|
||||
# SET_NOZZLE_LEDS_ON
|
||||
# SET_LOGO_LEDS_OFF
|
||||
# SET_NOZZLE_LEDS_OFF
|
||||
#
|
||||
# Contributed by Voron discord users wile.e, Tetsunosuke, and etherwalker
|
||||
|
||||
|
||||
[gcode_macro _sb_vars]
|
||||
# User settings for the StealthBurner status leds. You can change the status colors and led
|
||||
# configurations for the logo and nozzle here.
|
||||
variable_colors: {
|
||||
'logo': { # Colors for logo states
|
||||
'busy': {'r': 0.4, 'g': 0.0, 'b': 0.0, 'w': 0.0},
|
||||
'cleaning': {'r': 0.0, 'g': 0.02, 'b': 0.5, 'w': 0.0},
|
||||
'calibrating_z': {'r': 0.8, 'g': 0., 'b': 0.35, 'w': 0.0},
|
||||
'heating': {'r': 0.3, 'g': 0.18, 'b': 0.0, 'w': 0.0},
|
||||
'homing': {'r': 0.0, 'g': 0.6, 'b': 0.2, 'w': 0.0},
|
||||
'leveling': {'r': 0.5, 'g': 0.1, 'b': 0.4, 'w': 0.0},
|
||||
'meshing': {'r': 0.2, 'g': 1.0, 'b': 0.0, 'w': 0.0},
|
||||
'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
|
||||
'printing': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
|
||||
'standby': {'r': 0.01, 'g': 0.01, 'b': 0.01, 'w': 0.1},
|
||||
},
|
||||
'nozzle': { # Colors for nozzle states
|
||||
'heating': {'r': 0.8, 'g': 0.35, 'b': 0.0, 'w':0.0},
|
||||
'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
|
||||
'on': {'r': 0.8, 'g': 0.8, 'b': 0.8, 'w':1.0},
|
||||
'standby': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0},
|
||||
},
|
||||
'thermal': {
|
||||
'hot': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
|
||||
'cold': {'r': 0.3, 'g': 0.0, 'b': 0.3, 'w': 0.0}
|
||||
}
|
||||
}
|
||||
variable_logo_led_name: "sb_leds"
|
||||
# The name of the addressable LED chain that contains the logo LED(s)
|
||||
variable_logo_idx: "1"
|
||||
# A comma-separated list of indexes LEDs in the logo
|
||||
variable_nozzle_led_name: "sb_leds"
|
||||
# The name of the addressable LED chain that contains the nozzle LED(s). This will
|
||||
# typically be the same LED chain as the logo.
|
||||
variable_nozzle_idx: "2,3"
|
||||
# A comma-separated list of indexes of LEDs in the nozzle
|
||||
gcode:
|
||||
# This section is required. Do Not Delete.
|
||||
|
||||
|
||||
[gcode_macro _set_sb_leds]
|
||||
gcode:
|
||||
{% set red = params.RED|default(0)|float %}
|
||||
{% set green = params.GREEN|default(0)|float %}
|
||||
{% set blue = params.BLUE|default(0)|float %}
|
||||
{% set white = params.WHITE|default(0)|float %}
|
||||
{% set led = params.LED|string %}
|
||||
{% set idx = (params.IDX|string).split(',') %}
|
||||
{% set transmit_last = params.TRANSMIT|default(1) %}
|
||||
|
||||
{% for led_index in idx %}
|
||||
{% set transmit=transmit_last if loop.last else 0 %}
|
||||
set_led led={led} red={red} green={green} blue={blue} white={white} index={led_index} transmit={transmit}
|
||||
{% endfor %}
|
||||
|
||||
[gcode_macro _set_sb_leds_by_name]
|
||||
gcode:
|
||||
{% set leds_name = params.LEDS %}
|
||||
{% set color_name = params.COLOR %}
|
||||
{% set color = printer["gcode_macro _sb_vars"].colors[leds_name][color_name] %}
|
||||
{% set led = printer["gcode_macro _sb_vars"][leds_name + "_led_name"] %}
|
||||
{% set idx = printer["gcode_macro _sb_vars"][leds_name + "_idx"] %}
|
||||
{% set transmit = params.TRANSMIT|default(1) %}
|
||||
|
||||
_set_sb_leds led={led} red={color.r} green={color.g} blue={color.b} white={color.w} idx="{idx}" transmit={transmit}
|
||||
|
||||
[gcode_macro _set_logo_leds]
|
||||
gcode:
|
||||
{% set red = params.RED|default(0)|float %}
|
||||
{% set green = params.GREEN|default(0)|float %}
|
||||
{% set blue = params.BLUE|default(0)|float %}
|
||||
{% set white = params.WHITE|default(0)|float %}
|
||||
{% set led = printer["gcode_macro _sb_vars"].logo_led_name %}
|
||||
{% set idx = printer["gcode_macro _sb_vars"].logo_idx %}
|
||||
{% set transmit=params.TRANSMIT|default(1) %}
|
||||
|
||||
_set_sb_leds led={led} red={red} green={green} blue={blue} white={white} idx="{idx}" transmit={transmit}
|
||||
|
||||
[gcode_macro _set_nozzle_leds]
|
||||
gcode:
|
||||
{% set red = params.RED|default(0)|float %}
|
||||
{% set green = params.GREEN|default(0)|float %}
|
||||
{% set blue = params.BLUE|default(0)|float %}
|
||||
{% set white = params.WHITE|default(0)|float %}
|
||||
{% set led = printer["gcode_macro _sb_vars"].nozzle_led_name %}
|
||||
{% set idx = printer["gcode_macro _sb_vars"].nozzle_idx %}
|
||||
{% set transmit=params.TRANSMIT|default(1) %}
|
||||
|
||||
_set_sb_leds led={led} red={red} green={green} blue={blue} white={white} idx="{idx}" transmit={transmit}
|
||||
|
||||
[gcode_macro set_logo_leds_off]
|
||||
gcode:
|
||||
{% set transmit=params.TRANSMIT|default(1) %}
|
||||
_set_logo_leds red=0 blue=0 green=0 white=0 transmit={transmit}
|
||||
|
||||
[gcode_macro set_nozzle_leds_on]
|
||||
gcode:
|
||||
{% set transmit=params.TRANSMIT|default(1) %}
|
||||
_set_sb_leds_by_name leds="nozzle" color="on" transmit={transmit}
|
||||
|
||||
[gcode_macro set_nozzle_leds_off]
|
||||
gcode:
|
||||
{% set transmit=params.TRANSMIT|default(1) %}
|
||||
_set_sb_leds_by_name leds="nozzle" color="off" transmit={transmit}
|
||||
|
||||
[gcode_macro status_off]
|
||||
gcode:
|
||||
set_logo_leds_off transmit=0
|
||||
set_nozzle_leds_off
|
||||
|
||||
[gcode_macro status_ready]
|
||||
gcode:
|
||||
_set_sb_leds_by_name leds="logo" color="standby" transmit=0
|
||||
_set_sb_leds_by_name leds="nozzle" color="standby" transmit=1
|
||||
|
||||
[gcode_macro status_busy]
|
||||
gcode:
|
||||
_set_sb_leds_by_name leds="logo" color="busy" transmit=0
|
||||
set_nozzle_leds_on
|
||||
|
||||
[gcode_macro status_heating]
|
||||
gcode:
|
||||
_set_sb_leds_by_name leds="logo" color="heating" transmit=0
|
||||
_set_sb_leds_by_name leds="nozzle" color="heating" transmit=1
|
||||
|
||||
[gcode_macro status_leveling]
|
||||
gcode:
|
||||
_set_sb_leds_by_name leds="logo" color="leveling" transmit=0
|
||||
set_nozzle_leds_on
|
||||
|
||||
[gcode_macro status_homing]
|
||||
gcode:
|
||||
_set_sb_leds_by_name leds="logo" color="homing" transmit=0
|
||||
set_nozzle_leds_on
|
||||
|
||||
[gcode_macro status_cleaning]
|
||||
gcode:
|
||||
_set_sb_leds_by_name leds="logo" color="cleaning" transmit=0
|
||||
set_nozzle_leds_on
|
||||
|
||||
[gcode_macro status_meshing]
|
||||
gcode:
|
||||
_set_sb_leds_by_name leds="logo" color="meshing" transmit=0
|
||||
set_nozzle_leds_on
|
||||
|
||||
[gcode_macro status_calibrating_z]
|
||||
gcode:
|
||||
_set_sb_leds_by_name leds="logo" color="calibrating_z" transmit=0
|
||||
set_nozzle_leds_on
|
||||
|
||||
[gcode_macro status_printing]
|
||||
gcode:
|
||||
_set_sb_leds_by_name leds="logo" color="printing" transmit=0
|
||||
set_nozzle_leds_on
|
||||
Reference in New Issue
Block a user