добавлена щетка, смещение тача, переписан авд, праймлайн на тпу
This commit is contained in:
@@ -28,9 +28,16 @@ variable_calibrate_bed_mesh: True # строим ли карту стола
|
||||
variable_adaptive_mesh: True # используем адаптивный
|
||||
variable_high_power_bed: False # выключение нагрева стола при меше/таче - рекомендуется на мощных столах
|
||||
variable_touch_cart_enabled: True # тач картографера
|
||||
variable_touch_cart_fuzzy: 5 # смещение картографера при тыканье, 0-10 допустимо, 0 не сдвигаемся
|
||||
|
||||
# AWD
|
||||
#[include Macros/motor_sync.cfg.var] # требуется настройка
|
||||
variable_awd_sync_enabled: True # awd синхронизация перед началом печати, если не засинхрено
|
||||
|
||||
# вытирание носопырки перед тачем
|
||||
#[include Macros/nozzle_scrub.cfg.var] # требуется настройка
|
||||
variable_nozzle_scrub_enabled: False # вытирание носопырки перед тачем
|
||||
|
||||
variable_tgbot_enabled: True # Оповещения ботом о всем
|
||||
variable_beep_enabled: False # наличие пищалки в принтере
|
||||
variable_orbiter_sensor_cheat: True # отключение во время печати, сенсор - Orbiter_Sensor
|
||||
@@ -52,7 +59,7 @@ variable_preheat_extruder: True
|
||||
variable_preheat_extruder_temp: 150
|
||||
|
||||
# прайминг пластика, и где расположен
|
||||
variable_nozzle_priming: "primeblob"
|
||||
variable_nozzle_priming: "auto" # "primeblob"
|
||||
variable_nozzle_prime_start_x: "max" # min, max or number
|
||||
variable_nozzle_prime_start_y: "min" # min, max or number
|
||||
variable_nozzle_prime_direction: "auto" # auto, forwards, backwards
|
||||
|
||||
225
Macros/nozzle_scrub.cfg.var
Normal file
225
Macros/nozzle_scrub.cfg.var
Normal file
@@ -0,0 +1,225 @@
|
||||
#######################################################################################################################################
|
||||
|
||||
# Sample macro config to be used in conjunction with the Decontaminator Purge Bucket & Nozzle Scrubber mod. Created by Hernsl
|
||||
# (hernsl#8860 on Discord) and edited by Edwardyeeks (edwardyeeks#6042 on Discord). Several ideas that made it as features by
|
||||
# Deutherius (deutherius#3295 on Discord).
|
||||
|
||||
# The goal of this macro is to provide a nozzle scrubbing and purging routine that is easily copied/referenced into your printer.cfg.
|
||||
# Users can simply change parameters and enable/disable options in the first half. Descriptions are plentiful, making this macro
|
||||
# look huge but informative and are laid out in sequence to be read first describing the line below; PLEASE READ CAREFULLY.
|
||||
|
||||
# This sample config assumes the following: The user has implemented the default decontaminator purge bucket & nozzle scrubber mod
|
||||
# for the VORON 1/2. It can be tweaked to customised purge bucket geometries and brushes.
|
||||
|
||||
# Features in this macro: option of putting the bucket at the rear or front of the bed. Purge routine that can be enabled/disabled.
|
||||
# By default, bucket is located at rear left of bed and purge routine is enabled. The purge and scrubbing routine is randomized
|
||||
# in either left or right bucket to ensure as even as possible distribution of filament gunk.
|
||||
|
||||
# Default parameters are set for safe speeds and movements. Where necessary, tweak the parameters for the nozzle scrub procedure
|
||||
# to fit your printer.
|
||||
|
||||
# To avoid adding length of lines to your main printer.cfg config file, one can upload a config file separately into klipper and
|
||||
# include it into the main printer config. Upload nozzle_scrub.cfg to the same directory as printer.cfg. Usually, it is in /home/pi/.
|
||||
# Users of Fluidd, Mainsail and other klipper front ends would find it under /home/pi/klipper_config/.
|
||||
|
||||
# Once uploaded, add the following to your printer.cfg in the Macros section: [include /home/pi/nozzle_scrub.cfg]
|
||||
# Those running Fluidd, Mainsail and other front ends will need to use the following location instead:
|
||||
# [include /home/pi/klipper_config/nozzle_scrub.cfg]
|
||||
|
||||
#######################################################################################################################################
|
||||
|
||||
# Name of the macro is clean_nozzle.
|
||||
|
||||
[gcode_macro clean_nozzle]
|
||||
|
||||
# If you are putting your purge bucket at the rear left of the bed as per default installation, enable True on your location_bucket_rear
|
||||
# variable. If you want to put your purge bucket elsewhere (perhaps the front), then set it to False. See diagrams and description
|
||||
# further below on how to set your XY position.
|
||||
variable_location_bucket_rear: True
|
||||
|
||||
# If you want the purging routine in your bucket enabled, set to True (and vice versa).
|
||||
variable_enable_purge: True
|
||||
|
||||
# These parameters define your filament purging. The retract variable is used to retract right after purging to prevent unnecessary
|
||||
# oozing. Some filament are particularly oozy and may continue to ooze out of the nozzle for a second or two after retracting. The
|
||||
# ooze dwell variable makes allowance for this. Update as necessary. If you decided to not enable purge, you can ignore this section.
|
||||
variable_purge_len: 10 ; Amount of filament, in mm, to purge.
|
||||
variable_purge_spd: 150 ; Speed, in mm/min, of the purge.
|
||||
variable_purge_temp_min: 240 ; Minimum nozzle temperature to permit a purge. Otherwise, purge will not occur.
|
||||
variable_purge_ret: 2 ; Retract length, in mm, after purging to prevent slight oozing. Adjust as necessary.
|
||||
variable_ooze_dwell: 2 ; Dwell/wait time, in seconds, after purging and retracting.
|
||||
|
||||
# Adjust this so that your nozzle scrubs within the brush. Currently defaulted to be a lot higher for safety. Be careful not to go too low!
|
||||
variable_brush_top: 3
|
||||
|
||||
# These parameters define your scrubbing, travel speeds, safe z clearance and how many times you want to wipe. Update as necessary. Wipe
|
||||
# direction is randomized based off whether the left or right bucket is randomly selected in the purge & scrubbing routine.
|
||||
variable_clearance_z: 5 ; When traveling, but not cleaning, the clearance along the z-axis between nozzle and brush.
|
||||
variable_wipe_qty: 5 ; Number of complete (A complete wipe: left, right, left OR right, left, right) wipes.
|
||||
variable_prep_spd_xy: 3000 ; Travel (not cleaning) speed along x and y-axis in mm/min.
|
||||
variable_prep_spd_z: 1500 ; Travel (not cleaning) speed along z axis in mm/min.
|
||||
variable_wipe_spd_xy: 5000 ; Nozzle wipe speed in mm/min.
|
||||
|
||||
|
||||
# These parameters define the size of the brush. Update as necessary. A visual reference is provided below. Note that orientation of
|
||||
# parameters remain the same whether bucket is at rear or front.
|
||||
#
|
||||
# ← brush_width →
|
||||
# _________________ ↑
|
||||
# | | ↑ If you chose location_bucket_rear = True, Y position is acquired
|
||||
# brush_start (x) | | brush_depth from your stepper_y position_max. Adjust your brush physically in
|
||||
# |_________________| ↓ Y so that the nozzle scrubs within the brush.
|
||||
# (y) ↓
|
||||
# brush_front
|
||||
# __________________________________________________________
|
||||
# PRINTER FRONT
|
||||
#
|
||||
#
|
||||
## For V1.8, you may need to measure where your brush is on the x axis and input manually into any of the variable_brush_start uncommented.
|
||||
## For V2.4 250mm build, uncomment this below:
|
||||
#variable_brush_start: 25
|
||||
|
||||
## For V2.4 300mm build, uncomment this below:
|
||||
variable_brush_start: 50
|
||||
|
||||
## For V2.4 350mm build, uncomment this below:
|
||||
#variable_brush_start: 75
|
||||
|
||||
# This value is defaulted from brush location in CAD (rear left). Change if your brush width is different.
|
||||
variable_brush_width: 55
|
||||
|
||||
## These are only used if location_bucket_rear is False. You specify a custom location in y axis for your brush - see diagram above. ##
|
||||
variable_brush_front: 0
|
||||
variable_brush_depth: 3
|
||||
|
||||
|
||||
# These parameters define the size of your purge bucket. Update as necessary. If you decided to not enable purge, you can ignore
|
||||
# this section. A visual reference is provided below. Note that orientation of parameters remain the same whether bucket is at rear
|
||||
# or front.
|
||||
#
|
||||
# bucket_gap
|
||||
# ← ---- →
|
||||
# __________________________________________
|
||||
# | | | |
|
||||
# | | | |
|
||||
# bucket_start (x) | |______| |
|
||||
# | | | |
|
||||
# | | | |
|
||||
# |_________________|. . . |_________________|
|
||||
# ← ------------- → ← ------------- →
|
||||
# bucket_left_width bucket_right_width
|
||||
# _______________________________________________________________________________________
|
||||
# PRINTER FRONT
|
||||
#
|
||||
## For V2.4 250mm build, uncomment below
|
||||
#variable_bucket_left_width: 42
|
||||
|
||||
## For V2.4 300mm build, uncomment below
|
||||
variable_bucket_left_width: 67
|
||||
|
||||
## For V2.4 350mm build, uncomment below
|
||||
#variable_bucket_left_width: 92
|
||||
|
||||
# These values are defaulted from bucket geometry in CAD (rear left location). Change only if you're using a custom bucket.
|
||||
variable_bucket_right_width: 40
|
||||
variable_bucket_gap: 22
|
||||
|
||||
# For V1.8, you may need to measure where your bucket start is and input into bucket_start. Otherwise, a value of 0 is for a default
|
||||
# installation of purge bucket at rear left.
|
||||
variable_bucket_start: 0
|
||||
|
||||
|
||||
###############################################################################################################################################
|
||||
###############################################################################################################################################
|
||||
|
||||
### From here on, unless you know what you're doing, it's recommended not to change anything. Feel free to peruse the code and reach out to me
|
||||
### (edwardyeeks#6042) on Discord if you spot any problems!
|
||||
|
||||
###############################################################################################################################################
|
||||
###############################################################################################################################################
|
||||
|
||||
# Placeholder. The variable will later be set to contain, at random, a number representing the left or right bucket.
|
||||
variable_bucket_pos: 1
|
||||
|
||||
gcode:
|
||||
# First, check if the axes are homed.
|
||||
{% if "xyz" in printer.toolhead.homed_axes %}
|
||||
|
||||
## Save the gcode state in this macro instance.
|
||||
SAVE_GCODE_STATE NAME=clean_nozzle
|
||||
STATUS_CLEANING
|
||||
|
||||
## Set to absolute positioning.
|
||||
G90
|
||||
|
||||
## Grab max position of Y-axis from config to use in setting a fixed y position for location_bucket_rear = True.
|
||||
{% set Ry = printer.configfile.config["stepper_y"]["position_max"]|float %}
|
||||
|
||||
## Check if user enabled purge option or not.
|
||||
{% if enable_purge %}
|
||||
|
||||
### Randomly select left or right bin for purge. 0 = left, 1 = right
|
||||
SET_GCODE_VARIABLE MACRO=clean_nozzle VARIABLE=bucket_pos VALUE={(range(2) | random)}
|
||||
|
||||
### Raise Z for travel.
|
||||
G1 Z{brush_top + clearance_z} F{prep_spd_z}
|
||||
|
||||
### Check if user chose to use rear location.
|
||||
{% if location_bucket_rear %}
|
||||
G1 Y{Ry} F{prep_spd_xy}
|
||||
{% else %}
|
||||
G1 Y{brush_front + (brush_depth / 2)} F{prep_spd_xy}
|
||||
{% endif %}
|
||||
|
||||
### Position for purge. Randomly selects middle of left or right bucket. It references from the middle of the left bucket.
|
||||
G1 X{bucket_start + (bucket_left_width / (2 - bucket_pos)) + (bucket_pos * bucket_gap) + (bucket_pos * (bucket_right_width / 2))}
|
||||
|
||||
### Perform purge if the temp is up to min temp. If not, it will skip and continue executing rest of macro. Small retract after
|
||||
### purging to minimize any persistent oozing at 5x purge_spd. G4 dwell is in milliseconds, hence * 1000 in formula.
|
||||
{% if printer.extruder.temperature >= purge_temp_min %}
|
||||
M83 ; relative mode
|
||||
G1 E{purge_len} F{purge_spd}
|
||||
G1 E-{purge_ret} F{purge_spd * 5}
|
||||
G4 P{ooze_dwell * 1000}
|
||||
G92 E0 ; reset extruder
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
## Position for wipe. Either left or right of brush based off bucket_pos to avoid unnecessary travel.
|
||||
G1 Z{brush_top + clearance_z} F{prep_spd_z}
|
||||
G1 X{brush_start + (brush_width * bucket_pos)} F{prep_spd_xy}
|
||||
|
||||
## Check if user chose to use rear location.
|
||||
{% if location_bucket_rear %}
|
||||
G1 Y{Ry}
|
||||
{% else %}
|
||||
G1 Y{brush_front + (brush_depth / 2)}
|
||||
{% endif %}
|
||||
|
||||
## Move nozzle down into brush.
|
||||
G1 Z{brush_top} F{prep_spd_z}
|
||||
|
||||
## Perform wipe. Wipe direction based off bucket_pos for cool random scrubby routine.
|
||||
{% for wipes in range(1, (wipe_qty + 1)) %}
|
||||
G1 X{brush_start + (brush_width * (1 - bucket_pos))} F{wipe_spd_xy}
|
||||
G1 X{brush_start + (brush_width * bucket_pos)} F{wipe_spd_xy}
|
||||
{% endfor %}
|
||||
|
||||
## Clear from area.
|
||||
M117 Cleaned!
|
||||
G1 Z{brush_top + clearance_z} F{prep_spd_z}
|
||||
G1 X{bucket_start + (bucket_left_width / 4)} F{prep_spd_xy} #bugfix for right side mounted buckets
|
||||
|
||||
## Restore the gcode state to how it was before the macro.
|
||||
STATUS_READY
|
||||
RESTORE_GCODE_STATE NAME=clean_nozzle
|
||||
|
||||
|
||||
{% else %}
|
||||
|
||||
## raise error will stop any macros that clean_nozzle is referenced in from proceeding for safety.
|
||||
{ action_raise_error("Please home your axes!") }
|
||||
M117 Please home first!
|
||||
|
||||
{% endif %}
|
||||
37
Macros/sfs.cfg.var
Normal file
37
Macros/sfs.cfg.var
Normal file
@@ -0,0 +1,37 @@
|
||||
[filament_switch_sensor switch_sensor]
|
||||
switch_pin: ^filament_switch_sensor_pin # y_diag_pin
|
||||
pause_on_runout: False
|
||||
runout_gcode:
|
||||
PAUSE # [pause_resume] is required in printer.cfg
|
||||
M117 Filament switch runout
|
||||
{% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %}
|
||||
RESPOND PREFIX=tgnotify MSG="Filament switch runout!!"
|
||||
{% endif %}
|
||||
|
||||
|
||||
insert_gcode:
|
||||
M117 Filament switch inserted
|
||||
{% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %}
|
||||
RESPOND PREFIX=tgnotify MSG="Filament switch inserted!!"
|
||||
{% endif %}
|
||||
|
||||
|
||||
[filament_motion_sensor encoder_sensor]
|
||||
switch_pin: ^filament_encoder_sensor_pin
|
||||
detection_length: 6
|
||||
extruder: extruder
|
||||
pause_on_runout: False
|
||||
runout_gcode:
|
||||
#PAUSE # [pause_resume] is required in printer.cfg
|
||||
M117 Filament encoder runout
|
||||
{% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %}
|
||||
RESPOND PREFIX=tgnotify MSG="Filament encoder runout!!"
|
||||
{% endif %}
|
||||
|
||||
|
||||
insert_gcode:
|
||||
M117 Filament encoder inserted
|
||||
{% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %}
|
||||
RESPOND PREFIX=tgnotify MSG="Filament encoder inserted!!"
|
||||
{% endif %}
|
||||
|
||||
111
Scripts/TEST_SPEED.cfg
Normal file
111
Scripts/TEST_SPEED.cfg
Normal file
@@ -0,0 +1,111 @@
|
||||
# Home, get position, throw around toolhead, home again.
|
||||
# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured.
|
||||
# We only measure to a full step to accomodate for endstop variance.
|
||||
# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10
|
||||
|
||||
[gcode_macro TEST_SPEED]
|
||||
gcode:
|
||||
# Speed
|
||||
{% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %}
|
||||
# Iterations
|
||||
{% set iterations = params.ITERATIONS|default(5)|int %}
|
||||
# Acceleration
|
||||
{% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %}
|
||||
# Bounding inset for large pattern (helps prevent slamming the toolhead into the sides after small skips, and helps to account for machines with imperfectly set dimensions)
|
||||
{% set bound = params.BOUND|default(20)|int %}
|
||||
# Size for small pattern box
|
||||
{% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %}
|
||||
|
||||
# Large pattern
|
||||
# Max positions, inset by BOUND
|
||||
{% set x_min = printer.toolhead.axis_minimum.x + bound %}
|
||||
{% set x_max = printer.toolhead.axis_maximum.x - bound %}
|
||||
{% set y_min = printer.toolhead.axis_minimum.y + bound %}
|
||||
{% set y_max = printer.toolhead.axis_maximum.y - bound %}
|
||||
|
||||
# Small pattern at center
|
||||
# Find X/Y center point
|
||||
{% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %}
|
||||
{% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %}
|
||||
|
||||
# Set small pattern box around center point
|
||||
{% set x_center_min = x_center - (smallpatternsize/2) %}
|
||||
{% set x_center_max = x_center + (smallpatternsize/2) %}
|
||||
{% set y_center_min = y_center - (smallpatternsize/2) %}
|
||||
{% set y_center_max = y_center + (smallpatternsize/2) %}
|
||||
|
||||
# Save current gcode state (absolute/relative, etc)
|
||||
SAVE_GCODE_STATE NAME=TEST_SPEED
|
||||
|
||||
# Output parameters to g-code terminal
|
||||
{ action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) }
|
||||
|
||||
# Home and get position for comparison later:
|
||||
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
|
||||
G28 X Y
|
||||
# QGL if not already QGLd (only if QGL section exists in config)
|
||||
{% if printer.configfile.settings.quad_gantry_level %}
|
||||
{% if printer.quad_gantry_level.applied == False %}
|
||||
QUAD_GANTRY_LEVEL
|
||||
G28 Z
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
# Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24)
|
||||
G90
|
||||
G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60}
|
||||
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
|
||||
G28 X Y
|
||||
G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
|
||||
G4 P1000
|
||||
GET_POSITION
|
||||
|
||||
# Go to starting position
|
||||
G0 X{x_min} Y{y_min} F{speed*60}
|
||||
|
||||
# Set new limits
|
||||
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2}
|
||||
|
||||
{% for i in range(iterations) %}
|
||||
# Large pattern diagonals
|
||||
G0 X{x_min} Y{y_min} F{speed*60}
|
||||
G0 X{x_max} Y{y_max} F{speed*60}
|
||||
G0 X{x_min} Y{y_min} F{speed*60}
|
||||
G0 X{x_max} Y{y_min} F{speed*60}
|
||||
G0 X{x_min} Y{y_max} F{speed*60}
|
||||
G0 X{x_max} Y{y_min} F{speed*60}
|
||||
|
||||
# Large pattern box
|
||||
G0 X{x_min} Y{y_min} F{speed*60}
|
||||
G0 X{x_min} Y{y_max} F{speed*60}
|
||||
G0 X{x_max} Y{y_max} F{speed*60}
|
||||
G0 X{x_max} Y{y_min} F{speed*60}
|
||||
|
||||
# Small pattern diagonals
|
||||
G0 X{x_center_min} Y{y_center_min} F{speed*60}
|
||||
G0 X{x_center_max} Y{y_center_max} F{speed*60}
|
||||
G0 X{x_center_min} Y{y_center_min} F{speed*60}
|
||||
G0 X{x_center_max} Y{y_center_min} F{speed*60}
|
||||
G0 X{x_center_min} Y{y_center_max} F{speed*60}
|
||||
G0 X{x_center_max} Y{y_center_min} F{speed*60}
|
||||
|
||||
# Small patternbox
|
||||
G0 X{x_center_min} Y{y_center_min} F{speed*60}
|
||||
G0 X{x_center_min} Y{y_center_max} F{speed*60}
|
||||
G0 X{x_center_max} Y{y_center_max} F{speed*60}
|
||||
G0 X{x_center_max} Y{y_center_min} F{speed*60}
|
||||
{% endfor %}
|
||||
|
||||
# Restore max speed/accel/accel_to_decel to their configured values
|
||||
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
|
||||
|
||||
# Re-home and get position again for comparison:
|
||||
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
|
||||
G28 X Y# This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12
|
||||
# Go to XY home positions (in case your homing override leaves it elsewhere)
|
||||
G90
|
||||
G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
|
||||
G4 P1000
|
||||
GET_POSITION
|
||||
|
||||
# Restore previous gcode state (absolute/relative, etc)
|
||||
RESTORE_GCODE_STATE NAME=TEST_SPEED
|
||||
242
Scripts/adaptive_bed_mesh.cfg
Normal file
242
Scripts/adaptive_bed_mesh.cfg
Normal file
@@ -0,0 +1,242 @@
|
||||
#########################################
|
||||
########## ADAPTIVE BED MESH ############
|
||||
#########################################
|
||||
# Written by Frix_x#0161 #
|
||||
# @version: 4.0
|
||||
|
||||
# CHANGELOG:
|
||||
# v4.0: - patched and re-simplified the macro to work with latest Klipper changes: zero_reference_position is much more constrained and all the fancy stuff
|
||||
# that was used in the past for homing over the RRI with virtual probe or Z calibration plugin is not possible anymore. Now homing must be done at
|
||||
# fixed zero_reference_poisition and can't be dynamic anymore (but it's also simpler)
|
||||
# - this change also allow the mesh to have even probe point now for more flexibility
|
||||
# v3.0: - added the use of [exclude_object] tags to extract the first layer bounding box (many thanks to Kyleisah for the excellent idea and inspiration)
|
||||
# the macro is still fully compatible with the old way using the SIZE parameter: it will use it if specified, or else
|
||||
# fallback to the [exclude_object] method and if both are not available, it will do a full and normal bed mesh as usual.
|
||||
# - also added a FORCE_MESH parameter to mesh even for very small parts
|
||||
# - removed the RRI that was always added put in the BED_MESH_CALIBRATE call. Now it's added only when there is one defined in the [bed_mesh] section
|
||||
# v2.3: moved the install notes into a proper markdown file in: docs > features > adaptive_bed_mesh.md
|
||||
# v2.2: removed the requirement to set mesh_pps in the [bed_mesh] section. It's now again optional as it should be
|
||||
# v2.1: fix for the nominal mesh (when no SIZE parameter is used or SIZE=0_0_0_0)
|
||||
# v2.0: split in multple macros to be able to use the center point in the z calibration bed probing position before doing the mesh
|
||||
# v1.1: fix for a bug when parsing string when using uppercase letters in the [bed_mesh] section
|
||||
# v1.0: first adaptive bed mesh macro
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------------------------
|
||||
# If you want to use it into your own config, please install it as a standalone macro as described in the
|
||||
# installation section of this file: docs > features > adaptive_bed_mesh.md
|
||||
# -------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
### What is it ? ###
|
||||
# The adaptive bed mesh is simple: it's a normal bed mesh, but only "where" and "when" it's necessary.
|
||||
# Sometime I print small parts, sometime I print full plates and I like to get a precise bed_mesh (like 9x9 or more). However, it take a
|
||||
# lot of time and it's useless to probe all the plate for only a 5cm² part. So this is where the adaptive bed mesh is helping:
|
||||
# 1. It get the corners coordinates of the fisrt layer surface either from the slicer or the [exclude_object] tags
|
||||
# 2. It compute a new set of points to probe on this new zone to get at least the same precision as your standard bed mesh. For example, if
|
||||
# a normal bed mesh is set to 9x9 for 300mm², it will then compute 3x3 for a 100mm² surface. Also if for whatever reason your parts are in
|
||||
# the corner of the build plate (like for a damaged PEI in the center), it will follow them to probe this exact area.
|
||||
# 3. To go further, it will not do any bed_mesh if there is less than 3x3 points to probe (very small part alone) and choose/change the
|
||||
# algorithm (bicubic/lagrange) depending of the size and shape of the mesh computed (like 3x3 vs 3x9)
|
||||
|
||||
# Feel free to ping me on Discord (Frix_x#0161) if you need help or have any comments to improve it :)
|
||||
|
||||
|
||||
# ===========================================================================================================
|
||||
# DO NOT MODIFY THOSE VARIABLES (they are used internaly by the adaptive bed mesh macro)
|
||||
[gcode_macro _ADAPTIVE_MESH_VARIABLES]
|
||||
variable_ready: False
|
||||
variable_do_mesh: False
|
||||
variable_do_nominal: False
|
||||
variable_mesh_min: 0,0
|
||||
variable_mesh_max: 0,0
|
||||
variable_probe_count: 0,0
|
||||
variable_algo: "bicubic"
|
||||
gcode:
|
||||
|
||||
|
||||
[gcode_macro COMPUTE_MESH_PARAMETERS]
|
||||
description: Compute the mesh parameters and store them for later use
|
||||
gcode:
|
||||
# 1 ----- GET ORIGINAL BEDMESH PARAMS FROM CONFIG ----------------------
|
||||
{% set xMinConf, yMinConf = printer["configfile"].config["bed_mesh"]["mesh_min"].split(',')|map('trim')|map('int') %}
|
||||
{% set xMaxConf, yMaxConf = printer["configfile"].config["bed_mesh"]["mesh_max"].split(',')|map('trim')|map('int') %}
|
||||
{% set xProbeCntConf, yProbeCntConf = printer["configfile"].config["bed_mesh"]["probe_count"].split(',')|map('trim')|map('int') %}
|
||||
{% set algo = printer["configfile"].config["bed_mesh"]["algorithm"]|lower %}
|
||||
{% set xMeshPPS, yMeshPPS = (printer["configfile"].config["bed_mesh"]["mesh_pps"]|default('2,2')).split(',')|map('trim')|map('int') %}
|
||||
|
||||
{% set margin = params.MARGIN|default(5)|int %} # additional margin to mesh around the first layer
|
||||
{% set force_mesh = params.FORCE_MESH|default(False) %} # force the mesh even if it's a small part (ie. computed less than 3x3)
|
||||
|
||||
|
||||
# 2 ----- GET FIRST LAYER COORDINATES and SIZE -------------------------------------
|
||||
# If the SIZE parameter is defined and not a dummy placeholder, we use it to do the adaptive bed mesh logic
|
||||
{% set coordinatesFound = false %}
|
||||
{% if params.SIZE is defined and params.SIZE != "0_0_0_0" %}
|
||||
RESPOND MSG="Got a SIZE parameter for the adaptive bed mesh"
|
||||
{% set xMinSpec, yMinSpec, xMaxSpec, yMaxSpec = params.SIZE.split('_')|map('trim')|map('int') %}
|
||||
{% set coordinatesFound = true %}
|
||||
|
||||
{% elif printer.exclude_object is defined %}
|
||||
{% if printer.exclude_object.objects %}
|
||||
# Else if SIZE is not defined, we fallback to use the [exclude_object] tags
|
||||
# This method is derived from Kyleisah KAMP repository: https://github.com/kyleisah/Klipper-Adaptive-Meshing-Purging)
|
||||
RESPOND MSG="No SIZE parameter, using the [exclude_object] tags for the adaptive bed mesh"
|
||||
{% set eo_points = printer.exclude_object.objects|map(attribute='polygon')|sum(start=[]) %}
|
||||
{% set xMinSpec = eo_points|map(attribute=0)|min %}
|
||||
{% set yMinSpec = eo_points|map(attribute=1)|min %}
|
||||
{% set xMaxSpec = eo_points|map(attribute=0)|max %}
|
||||
{% set yMaxSpec = eo_points|map(attribute=1)|max %}
|
||||
{% set coordinatesFound = true %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if not coordinatesFound %}
|
||||
# If no SIZE parameter and no [exclude_object] tags, then we want to do a nominal bed mesh
|
||||
# so nothing to do here...
|
||||
RESPOND MSG="No info about the first layer coordinates, doing a nominal bed mesh instead of adaptive"
|
||||
{% endif %}
|
||||
|
||||
|
||||
# If the first layer size was correctly retrieved, we can do the adaptive bed mesh logic, else we
|
||||
# fallback to the original and nominal BED_MESH_CALIBRATE function (full bed probing)
|
||||
{% if xMinSpec and yMinSpec and xMaxSpec and yMaxSpec %}
|
||||
|
||||
# 3 ----- APPLY MARGINS ----------------------------------------------
|
||||
# We use min/max function as we want it to be constrained by the original
|
||||
# bedmesh size. This will avoid going outside the machine limits
|
||||
{% set xMin = [xMinConf, (xMinSpec - margin)]|max %}
|
||||
{% set xMax = [xMaxConf, (xMaxSpec + margin)]|min %}
|
||||
{% set yMin = [yMinConf, (yMinSpec - margin)]|max %}
|
||||
{% set yMax = [yMaxConf, (yMaxSpec + margin)]|min %}
|
||||
|
||||
# 4 ----- COMPUTE A NEW PROBE COUNT ----------------------------------
|
||||
# The goal is to have at least the same precision as from the config. So we compute an equivalent number
|
||||
# of probe points on each X/Y dimensions (distance between two points should be the same as in the config)
|
||||
{% set xProbeCnt = ((xMax - xMin) * xProbeCntConf / (xMaxConf - xMinConf))|round(0, 'ceil')|int %}
|
||||
{% set yProbeCnt = ((yMax - yMin) * yProbeCntConf / (yMaxConf - yMinConf))|round(0, 'ceil')|int %}
|
||||
|
||||
# Then, three possibilities :
|
||||
# a) Both dimensions have less than 3 probe points : the bed_mesh is not needed as it's a small print (if not forced).
|
||||
# b) If one of the dimension is less than 3 and the other is greater. The print looks to be elongated and
|
||||
# need the adaptive bed_mesh : we add probing points to the small direction to reach 3 and be able to do it.
|
||||
# c) If both direction are greater than 3, we need the adaptive bed_mesh and it's ok.
|
||||
# At the end we control (according to Klipper bed_mesh method: "_verify_algorithm") that the computed probe_count is
|
||||
# valid according to the choosen algorithm or change it if needed.
|
||||
{% if xProbeCnt < 3 and yProbeCnt < 3 %}
|
||||
{% if force_mesh %}
|
||||
RESPOND MSG="Bed mesh forced (small part detected): meshing 3x3..."
|
||||
{% set xProbeCnt = 3 %}
|
||||
{% set yProbeCnt = 3 %}
|
||||
{% set algo = "lagrange" %}
|
||||
{% set mesh_min = "%d,%d"|format(xMin, yMin) %}
|
||||
{% set mesh_max = "%d,%d"|format(xMax, yMax) %}
|
||||
{% set probe_count = "%d,%d"|format(xProbeCnt, yProbeCnt) %}
|
||||
RESPOND MSG="Computed mesh parameters: MESH_MIN={mesh_min} MESH_MAX={mesh_max} PROBE_COUNT={probe_count} ALGORITHM={algo}"
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=do_mesh VALUE={True}
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=do_nominal VALUE={False}
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=mesh_min VALUE='"{mesh_min}"'
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=mesh_max VALUE='"{mesh_max}"'
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=probe_count VALUE='"{probe_count}"'
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=algo VALUE='"{algo}"'
|
||||
{% else %}
|
||||
RESPOND MSG="Computed mesh parameters: none, bed mesh not needed for very small parts"
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=do_mesh VALUE={False}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% set xProbeCnt = [3, xProbeCnt]|max %}
|
||||
{% set yProbeCnt = [3, yProbeCnt]|max %}
|
||||
|
||||
# Check of the probe points and interpolation algorithms according to Klipper code
|
||||
{% if xMeshPPS != 0 or yMeshPPS != 0 %}
|
||||
{% set probeCntMin = [xProbeCnt, yProbeCnt]|min %}
|
||||
{% set probeCntMax = [xProbeCnt, yProbeCnt]|max %}
|
||||
{% if algo == "lagrange" and probeCntMax > 6 %}
|
||||
# Lagrange interpolation tends to oscillate when using more than 6 samples: swith to bicubic
|
||||
{% set algo = "bicubic" %}
|
||||
{% endif %}
|
||||
{% if algo == "bicubic" and probeCntMin < 4 %}
|
||||
{% if probeCntMax > 6 %}
|
||||
# Impossible case: need to add probe point on the small axis to be >= 4 (we want 5 to keep it odd)
|
||||
{% if xProbeCnt > yProbeCnt %}
|
||||
{% set yProbeCnt = 5 %}
|
||||
{% else %}
|
||||
{% set xProbeCnt = 5 %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
# In this case bicubic is not adapted (less than 4 points): switch to lagrange
|
||||
{% set algo = "lagrange" %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# 5 ----- FORMAT THE PARAMETERS AND SAVE THEM ---------------------------
|
||||
{% set mesh_min = "%d,%d"|format(xMin, yMin) %}
|
||||
{% set mesh_max = "%d,%d"|format(xMax, yMax) %}
|
||||
{% set probe_count = "%d,%d"|format(xProbeCnt, yProbeCnt) %}
|
||||
RESPOND MSG="Computed mesh parameters: MESH_MIN={mesh_min} MESH_MAX={mesh_max} PROBE_COUNT={probe_count} ALGORITHM={algo}"
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=do_mesh VALUE={True}
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=do_nominal VALUE={False}
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=mesh_min VALUE='"{mesh_min}"'
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=mesh_max VALUE='"{mesh_max}"'
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=probe_count VALUE='"{probe_count}"'
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=algo VALUE='"{algo}"'
|
||||
{% endif %}
|
||||
{% else %}
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=do_mesh VALUE={True}
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=do_nominal VALUE={True}
|
||||
{% endif %}
|
||||
|
||||
# Finaly save in the variables that we already computed the values
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=ready VALUE={True}
|
||||
|
||||
|
||||
[gcode_macro ADAPTIVE_BED_MESH]
|
||||
description: Perform a bed mesh, but only where and when it's needed
|
||||
gcode:
|
||||
{% set ready = printer["gcode_macro _ADAPTIVE_MESH_VARIABLES"].ready %}
|
||||
|
||||
{% if not 'xyz' in printer.toolhead.homed_axes %}
|
||||
{ action_raise_error("Must Home printer first!") }
|
||||
{% endif %}
|
||||
|
||||
# If the parameters where computed, we can do the mesh by calling the _DO_ADAPTIVE_MESH
|
||||
{% if ready %}
|
||||
_DO_ADAPTIVE_MESH
|
||||
|
||||
# If the parameters where not computed prior to the ADAPTIVE_BED_MESH call, we call the COMPUTE_MESH_PARAMETERS
|
||||
# macro first and then call the _DO_ADAPTIVE_MESH macro after it
|
||||
{% else %}
|
||||
RESPOND MSG="Adaptive bed mesh: parameters not already computed, automatically calling the COMPUTE_MESH_PARAMETERS macro prior to the mesh"
|
||||
COMPUTE_MESH_PARAMETERS {rawparams}
|
||||
M400 # mandatory to flush the gcode buffer and be sure to use the last computed parameters
|
||||
_DO_ADAPTIVE_MESH
|
||||
{% endif %}
|
||||
|
||||
|
||||
[gcode_macro _DO_ADAPTIVE_MESH]
|
||||
gcode:
|
||||
# 1 ----- POPULATE BEDMESH PARAMS FROM SAVED VARIABLES ----------------------
|
||||
{% set do_mesh = printer["gcode_macro _ADAPTIVE_MESH_VARIABLES"].do_mesh %}
|
||||
{% set do_nominal = printer["gcode_macro _ADAPTIVE_MESH_VARIABLES"].do_nominal %}
|
||||
{% set mesh_min = printer["gcode_macro _ADAPTIVE_MESH_VARIABLES"].mesh_min %}
|
||||
{% set mesh_max = printer["gcode_macro _ADAPTIVE_MESH_VARIABLES"].mesh_max %}
|
||||
{% set probe_count = printer["gcode_macro _ADAPTIVE_MESH_VARIABLES"].probe_count %}
|
||||
{% set algo = printer["gcode_macro _ADAPTIVE_MESH_VARIABLES"].algo %}
|
||||
|
||||
# 2 --------- ADAPTIVE_BED_MESH LOGIC --------------------------------------
|
||||
|
||||
# If it's necessary to do a mesh
|
||||
{% if do_mesh %}
|
||||
# If it's a standard bed_mesh to be done
|
||||
{% if do_nominal %}
|
||||
RESPOND MSG="Adaptive bed mesh: nominal bed mesh"
|
||||
BED_MESH_CALIBRATE
|
||||
{% else %}
|
||||
RESPOND MSG="Adaptive bed mesh: MESH_MIN={mesh_min} MESH_MAX={mesh_max} PROBE_COUNT={probe_count} ALGORITHM={algo}"
|
||||
BED_MESH_CALIBRATE MESH_MIN={mesh_min} MESH_MAX={mesh_max} PROBE_COUNT={probe_count} ALGORITHM={algo}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
RESPOND MSG="Adaptive bed mesh: no mesh to be done"
|
||||
{% endif %}
|
||||
|
||||
# Set back the 'ready' parameter to false
|
||||
SET_GCODE_VARIABLE MACRO=_ADAPTIVE_MESH_VARIABLES VARIABLE=ready VALUE={False}
|
||||
@@ -138,8 +138,13 @@ gcode:
|
||||
BED_MESH_CALIBRATE PROFILE={default_profile}
|
||||
BED_MESH_PROFILE LOAD={default_profile}
|
||||
{% endif %}
|
||||
{% if printer["gcode_macro RatOS"].nozzle_scrub_enabled|lower == 'true' %}
|
||||
M190 S{TARGET_TEMP}
|
||||
clean_nozzle
|
||||
M140 S0
|
||||
{% endif %}
|
||||
{% if printer["gcode_macro RatOS"].touch_cart_enabled|lower == 'true' %}
|
||||
CARTOGRAPHER_TOUCH ; Perform touch probe
|
||||
CARTOGRAPHER_TOUCH FUZZY = {printer["gcode_macro RatOS"].touch_cart_fuzzy} ; Perform touch probe
|
||||
{% endif %}
|
||||
M190 S{TARGET_TEMP}
|
||||
{% elif printer["gcode_macro RatOS"].bed_mesh_profile is defined %}
|
||||
@@ -166,6 +171,13 @@ gcode:
|
||||
{% if has_offset %}
|
||||
ADD_PRIME_PROBE_TO_OFFSET
|
||||
{% endif %}
|
||||
{% if printer["gcode_macro RatOS"].nozzle_priming|lower == 'auto' %}
|
||||
{% if params.MATERIAL is defined and params.MATERIAL|lower == 'tpu'%}
|
||||
PRIME_LINE
|
||||
{% else %}
|
||||
PRIME_BLOB
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if printer["gcode_macro RatOS"].nozzle_priming|lower == 'primeline' %}
|
||||
PRIME_LINE
|
||||
{% endif %}
|
||||
|
||||
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